vscode-terminals icon indicating copy to clipboard operation
vscode-terminals copied to clipboard

Color and icon is not applied

Open alextegelid opened this issue 2 years ago • 20 comments

Color and icon for the terminals is not working. Setting "color": "#00ff00" or "icon": "github" for example doesn't do anything. I've debugged a bit and I can see the colors and icons being set on the terminals, but it's not shown on the actual terminal icon.

Here you can see the color being included in the creationOptions: CleanShot 2022-09-01_06 17 05@2x

My terminals.json:

{
  "autorun": true,
  "autokill": true,
  "terminals": [
    {
      "name": "Next",
      "commands": ["npm run dev"],
      "color": "#ff0000"
    },

    {
      "name": "Util",
      "color": "#ff0000"
    }
  ]
}

alextegelid avatar Sep 01 '22 04:09 alextegelid

Hello,

Same here.

On Windows: only icon works but no color applied (terminal.ansiBlue or #ee3355ff) On MacOSX: no icon and no color working

StoryDevOffical avatar Sep 07 '22 17:09 StoryDevOffical

Hello,

From my end (Windows 10), colors and icons are visible for like half a second and then seems to be reset to default.

SGirousse avatar Sep 08 '22 14:09 SGirousse

true, same behavior on MAC, now i saw it(icon and color) too before reset to default.

StoryDevOffical avatar Sep 09 '22 07:09 StoryDevOffical

Same here, both mac and windows

Safimmi avatar Sep 10 '22 04:09 Safimmi

It seems like the customisations are applied at first and then overruled - probably related to July 2022 release of VS Code with default integrated terminal color and icon settings...

https://code.visualstudio.com/updates/v1_70#_default-color-and-icon-tab-settings

arthurfincham avatar Sep 15 '22 09:09 arthurfincham

Indeed it seems to be related to that update. I just tried it on 1.69.1 and that works fine. Maybe this is a bug in VS Code then...

alextegelid avatar Sep 20 '22 10:09 alextegelid

Indeed it seems to be related to that update. I just tried it on 1.69.1 and that works fine. Maybe this is a bug in VS Code then...

I'm on fresh and recent install (1.71.2) :

Version: 1.71.2 (user setup)
Commit: 74b1f979648cc44d385a2286793c226e611f59e7
Date: 2022-09-14T21:03:37.738Z
Electron: 19.0.12
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.19043
Sandboxed: No

SGirousse avatar Sep 20 '22 14:09 SGirousse

Maybe it will work again if the extension will set these multiple times 🤔 I'll look into that.

fabiospampinato avatar Nov 15 '22 20:11 fabiospampinato

It looks like there are no APIs for changing the icon or the color of a terminal after it has been created, so I guess this is just broken in vscode for now.

/cc @Tyriar if you'd like to take a look into this issue.

fabiospampinato avatar Nov 19 '22 15:11 fabiospampinato

@fabiospampinato do you mean you have an existing Terminal object and you want to change the icon and color? This would be a new API request.

Tyriar avatar Nov 29 '22 22:11 Tyriar

@Tyriar Yes-ish, basically this extension is setting the icon and the color when creating each terminal, and it was working fine in the past, but since some recent release apparently it stopped working, and people are suggesting it's because some new setting is interfering with that, basically overriding what the extension is doing.

So in some sense we don't really need new APIs, those settings that interfere should just be implemented in a way that they don't do anything if the terminal has already a custom icon/color set, which seems probably what should happen.

If that's not implementable or if it's undesirable for some reason then the only way to restore that functionality for this extension seems to be able to override icon and color again via some new API.

fabiospampinato avatar Nov 29 '22 22:11 fabiospampinato

basically this extension is setting the icon and the color when creating each terminal, and it was working fine in the past, but since some recent release apparently it stopped working

Can you point to where it's getting set? It you create the terminal it should work, if you are trying to set Terminal.creationOptions it should not.

Tyriar avatar Nov 29 '22 22:11 Tyriar

@Tyriar icon and color are being passed to createTerminal here: https://github.com/fabiospampinato/vscode-terminals/blob/dbc7080f9c619e323e36f4487ceca5dce4fd068b/src/run.ts#L113

fabiospampinato avatar Nov 29 '22 22:11 fabiospampinato

Thanks, let's track in https://github.com/microsoft/vscode/issues/167643

Tyriar avatar Nov 29 '22 22:11 Tyriar

As a temporary fix, I got it to work by manually assigning the shellPath, even if it is my default one. I've only tested in Windows, though.

"shellPath": "C:\\Program Files\\PowerShell\\7\\pwsh.exe"

tiageta avatar Dec 26 '22 18:12 tiageta

On windows, there is no problem anymore on my side, but on MAC the problem still is.

StoryDevOffical avatar Jan 12 '23 09:01 StoryDevOffical

As a temporary fix, I got it to work by manually assigning the shellPath, even if it is my default one. I've only tested in Windows, though.

"shellPath": "C:\\Program Files\\PowerShell\\7\\pwsh.exe"

Worked for me too, but only fixed the icon but not the color:

"shellPath": "C:\\Program Files\\Git\\bin\\bash.exe" EDIT: fixed the color too, when applied to each terminal setting

vikingprank avatar Jan 18 '23 09:01 vikingprank

Can confirm adding shellPath fixes the icons on wsl2/ubuntu too.

My terminals.json:

{
    "autorun": true,
    "autokill": true,
    "terminals": [
        {
            "name": "Server",
            "shellPath": "/usr/bin/zsh",
            "icon": "cloud",
            "open": true,
            "focus": true,
            "commands": [
                "cd /home/my-username/projects/my-project/server",
                "npm run start:debug"
            ]
        },
        {
            "name": "Client",
            "shellPath": "/usr/bin/zsh",
            "icon": "browser",
            "open": true,
            "focus": false,
            "commands": [
                "cd /home/my-username/projects/my-project/client",
                "npm start"
            ]
        }
    ]
}

sullivan-ben avatar Feb 01 '23 21:02 sullivan-ben

As a temporary fix, I got it to work by manually assigning the shellPath, even if it is my default one. I've only tested in Windows, though.

"shellPath": "C:\\Program Files\\PowerShell\\7\\pwsh.exe"

Worked for me too, but only fixed the icon but not the color:

"shellPath": "C:\\Program Files\\Git\\bin\\bash.exe" EDIT: fixed the color too, when applied to each terminal setting

This did it for me. Thanks!

eduardohilariodev avatar Mar 08 '23 12:03 eduardohilariodev

Thank you for this workaround ! Working on my mac with the following code:

{
      "name": "my terminal",
      "icon": "watch",
      "color": "terminal.ansiCyan",
      "shellPath": "/bin/zsh",
}

icodeyou avatar Mar 13 '23 17:03 icodeyou