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

Color and icon is not applied #77

Open
alextegelid opened this issue Sep 1, 2022 · 20 comments
Open

Color and icon is not applied #77

alextegelid opened this issue Sep 1, 2022 · 20 comments
Labels

Comments

@alextegelid
Copy link
Contributor

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"
    }
  ]
}
@StoryDevOffical
Copy link

Hello,

Same here.

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

@SGirousse
Copy link

Hello,

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

@StoryDevOffical
Copy link

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

@Safimmi
Copy link

Safimmi commented Sep 10, 2022

Same here, both mac and windows

@arthurfincham
Copy link

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

@alextegelid
Copy link
Contributor Author

alextegelid commented Sep 20, 2022

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...

@SGirousse
Copy link

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

@fabiospampinato
Copy link
Owner

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

@fabiospampinato
Copy link
Owner

fabiospampinato commented Nov 19, 2022

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.

@Tyriar
Copy link

Tyriar commented Nov 29, 2022

@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.

@fabiospampinato
Copy link
Owner

fabiospampinato commented Nov 29, 2022

@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.

@Tyriar
Copy link

Tyriar commented Nov 29, 2022

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.

@fabiospampinato
Copy link
Owner

fabiospampinato commented Nov 29, 2022

@Tyriar icon and color are being passed to createTerminal here:

term = cacheTerm || vscode.window.createTerminal ({ cwd, env, name: title, color: colorPath, iconPath, shellPath, shellArgs });

@Tyriar
Copy link

Tyriar commented Nov 29, 2022

Thanks, let's track in microsoft/vscode#167643

@tiageta
Copy link

tiageta commented Dec 26, 2022

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"

@StoryDevOffical
Copy link

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

@vikingprank
Copy link

vikingprank commented Jan 18, 2023

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

@sullivan-ben
Copy link

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"
            ]
        }
    ]
}

@eduardohilariodev
Copy link

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!

@icodeyou
Copy link

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests