visual-studio-code

Change VsCode terminal tabs icon and color with the cli


I would like to be able to change the color & icon of my terminal tabs & colors with the cli.

enter image description here

This could be the result
enter image description here

The reason of it would be to use the restore terminals extension, and then automatically set the a different icon and color of each terminal.

But I can't find it through the documentation, is it somehow doable?


Solution

  • If someone is still interested, this can be done. At least right now you can specify the profile for the terminal in the extension settings:

    "restoreTerminals.terminals": [
        {
          "profile": "Coverage",
          "splitTerminals": [
            {
              "name": "Coverage",
            }
          ]
        },
        {
          "profile": "Server",
          "splitTerminals": [
            {
              "name": "Server",
            }
          ]
        }
      ]
    

    So you can actually create a profile for each terminal you want like so:

    "terminal.integrated.profiles.windows": {
        "Coverage": {
          "path": ["D:\\Program Files\\Git\\bin\\bash.exe"],
          "icon": "beaker",
          "color": "terminal.ansiGreen"
        },
        "Server": {
          "path": ["D:\\Program Files\\Git\\bin\\bash.exe"],
          "icon": "server",
          "color": "terminal.ansiMagenta"
        }
      },
    

    And done:

    Terminals

    THIS METHOD NO LONGER WORKS PLASE SEE THE METHOD BELLOW

    I'm now using the extension Terminals Manager

    You can take a look at the documentation, but this is my current extension settings:

      "terminal.integrated.hideOnStartup": "always",
      "terminal.integrated.enablePersistentSessions": false,
    
      "terminals.invertCommandsAndDescription": false,
      "terminals.showCommands": false,
      "terminals.showDescriptions": true,
      "terminals.sortTerminals": false,
      "terminals.env": {},
      "terminals.multiplexer": "screen",
      "workbench.startupEditor": "readme",
      "terminals.autorun": true,
      "terminals.autokill": true,
    

    Then finally, you can configure your terminals indivisually. Here is my configuration for that:

    "terminals.terminals": [
        {
          "name": "Sonar",
          "description": "Terminal to run static analyzer sonar-scanner",
          "icon": "checklist",
          "color": "terminal.ansiCyan",
          "recycle": true
        },
        {
          "name": "Test",
          "description": "Terminal to run testes",
          "color": "terminal.ansiGreen",
          "icon": "beaker",
          "command": "npm run testCov",
          "execute": false,
          "recycle": true
        },
        {
          "name": "Server",
          "description": "Terminal to run the current program",
          "color": "terminal.ansiMagenta",
          "icon": "server",
          "command": "npm run startDev",
          "execute": false,
          "recycle": true,
          "focus": true
        },
        {
          "name": "Git",
          "description": "Terminal to run git and other misc commands",
          "color": "terminal.ansiYellow",
          "icon": "git-branch",
          "recycle": true
        }
      ],