Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task icon for terminal tab entry does not update with task label when terminal is reused #179337

Closed
ruffsl opened this issue Apr 5, 2023 · 3 comments · Fixed by #179596
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders tasks Task system issues terminal-tabs verified Verification succeeded
Milestone

Comments

@ruffsl
Copy link

ruffsl commented Apr 5, 2023

Type: Bug

When a terminal is reused by different tasks, the icon in it's terminal tabs entry is never updated to reflect the current task that is reusing it. One would expect that just as how the label for the terminal's tab entry updates to match the label for the latest task, that it's icon would similarly be updated to provide a consistent visual and textual feedback of the terminal's current task status.

Steps to Reproduce:
Using the example tasks.json included below:

  1. Close all terminals
  2. Tasks: Run Tasks -> debug-start
  3. Tasks: Run Tasks -> debug-stop

OR

  1. Close all terminals
  2. Tasks: Run Tasks -> Start then Stop
.vscode/tasks.json
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "debug-start",
            "icon": {
                "id": "debug-start"
            },
            "type": "shell",
            "command": "echo start",
            "problemMatcher": []
        },
        {
            "label": "debug-stop",
            "icon": {
                "id": "debug-stop"
            },
            "type": "shell",
            "command": "echo stop",
            "problemMatcher": []
        },
        {
            "label": "Start then Stop",
            "dependsOn": [
                "debug-start",
                "debug-stop"
            ],
            "dependsOrder": "sequence",
            "problemMatcher": []
        }
    ]
}

Expected:

  • the task icon should change from :debug-start: to :debug-stop:

image

Observed:

  • the task icon remains the same as whatever it was first initialized to

image

DOM HTML Snippet
<div class="monaco-list-row selected" role="listitem" data-index="3" data-last-element="true" data-parity="odd"
    aria-setsize="4" aria-posinset="4" id="list_id_1_3" aria-selected="true" aria-label="Terminal 27 debug-stop"
    draggable="true" style="top: 66px; height: 22px; line-height: 22px;">
    <div class="terminal-tabs-entry has-text is-active">
        <div
            class="monaco-icon-label file-icon 5e02f7f6f1a0a881b28c849108a10606-name-dir-icon 27-name-file-icon name-file-icon ext-file-icon unknown-lang-file-icon monaco-decoration-itemColor--w77yvu monaco-decoration-itemBadge--w77yvu monaco-decoration-iconBadge--w77yvu">
            <div class="monaco-icon-label-container"><span class="monaco-icon-name-container"><a
                        class="label-name"><span class="monaco-highlighted-label"><span
                                class="codicon codicon-debug-start"></span> debug-stop</span></a></span><span
                    class="monaco-icon-description-container"><span class="label-description"><span
                            class="monaco-highlighted-label">Task</span></span></span></div>
            <div class="actions">
                <div class="monaco-action-bar animated">
                    <ul class="actions-container" role="toolbar">
                        <li class="action-item" role="presentation" title="Split (Ctrl+Shift+5)"><a
                                class="action-label codicon codicon-split-horizontal" role="button"
                                aria-label="Split (Ctrl+Shift+5)" tabindex="0"></a></li>
                        <li class="action-item" role="presentation" title="Kill (Delete)"><a
                                class="action-label codicon codicon-trashcan" role="button"
                                aria-label="Kill (Delete)"></a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>

VS Code version: Code - Insiders 1.78.0-insider (8f74fbf, 2023-04-05T05:27:51.301Z)
OS version: Linux x64 5.19.0-38-generic
Modes:
Sandboxed: Yes

System Info
Item Value
CPUs Intel(R) Core(TM) i7
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 2, 1, 1
Memory (System) 31.17GB (15.15GB free)
Process Argv --unity-launch
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
Extensions: none
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythontb:30258533
vsc_aa:30263845
pythonptprofiler:30281269
vsdfh931cf:30280410
vshan820:30294714
pythondataviewer:30285072
vscod805cf:30301675
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30404738
cppdebug:30492333
vsclangdf:30492506
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30618038
pylantcb52:30590116
nodejswelcome1:30587009
pyind779:30611226
pythonsymbol12:30651887
2i9eh265:30646982
showlangstatbar:30659908
pythonb192:30661256
functionswalk:30687959
pythonms35:30671666
19089226:30680468
57b77579:30687741
pythonclientmv:30700173

@ruffsl
Copy link
Author

ruffsl commented Apr 5, 2023

Perhaps this updateStyles function in terminalView.ts has something to do with this?

for (const instance of this._terminalService.instances) {
const icon = instance.icon;
if (!icon) {
continue;
}
let uri = undefined;
if (icon instanceof URI) {
uri = icon;
} else if (icon instanceof Object && 'light' in icon && 'dark' in icon) {
uri = colorTheme.type === ColorScheme.LIGHT ? icon.light : icon.dark;
}
const iconClasses = getUriClasses(instance, colorTheme.type);
if (uri instanceof URI && iconClasses && iconClasses.length > 1) {
css += (
`.monaco-workbench .${iconClasses[0]} .monaco-highlighted-label .codicon, .monaco-action-bar .terminal-uri-icon.single-terminal-tab.action-label:not(.alt-command) .codicon` +
`{background-image: ${dom.asCSSUrl(uri)};}`
);
}
}

@rebornix rebornix assigned meganrogge and unassigned rebornix Apr 6, 2023
@meganrogge meganrogge added help wanted Issues identified as good community contribution opportunities tasks Task system issues terminal-tabs bug Issue identified by VS Code Team member as probable bug labels Apr 6, 2023
@weartist
Copy link
Contributor

weartist commented Apr 8, 2023

I'll go and try to fix this

weartist added a commit to weartist/vscode that referenced this issue Apr 10, 2023
… with task label when terminal is reused
@meganrogge meganrogge added this to the April 2023 milestone Apr 13, 2023
meganrogge added a commit that referenced this issue Apr 13, 2023
…pdate

fix #179337 Task icon for terminal tab entry does not update with task label when terminal is reused
@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Apr 13, 2023
@ruffsl
Copy link
Author

ruffsl commented Apr 20, 2023

Looks like it's now working with the insiders release!

output.webm

VS Code version: Code - Insiders 1.78.0-insider (208bbb0, 2023-04-20T05:21:04.496Z)
OS version: Linux x64 5.19.0-38-generic
Modes:
Sandboxed: Yes

System Info
Item Value
CPUs Intel(R) Core(TM) i7
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 2, 2, 2
Memory (System) 31.17GB (21.79GB free)
Process Argv --unity-launch --crash-reporter-id 257cd313-345d-421b-8b03-025753578071
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
Extensions: none
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythontb:30258533
vsc_aa:30263845
pythonptprofiler:30281269
vsdfh931cf:30280410
vshan820:30294714
pythondataviewer:30285072
vscod805cf:30301675
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30404738
cppdebug:30492333
vsclangdf:30492506
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30618038
pylantcb52:30590116
nodejswelcome1:30587009
pyind779:30611226
pythonsymbol12:30651887
2i9eh265:30646982
showlangstatbar:30659908
functionswalk:30687959
pythonms35:30671666
19089226:30680468
57b77579:30687741
pythonfmttext:30716741
pythonclientmv:30700173
hidecppwlkth:30715167

@DonJayamanne DonJayamanne added the verified Verification succeeded label Apr 26, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders tasks Task system issues terminal-tabs verified Verification succeeded
Projects
None yet
6 participants