- Instant help with your Developer coding problems

Change colors in VS Code integrated terminal

Question:
How to change colors in VS Code integrated terminal?
Answer:
"workbench.colorCustomizations": {
    "terminal.background":"#131212",
    "terminal.foreground":"#dddad6",
    "terminal.ansiBlack":"#1D2021",
    "terminal.ansiBrightBlack":"#665C54",
    "terminal.ansiBrightBlue":"#0D6678",
    "terminal.ansiBrightCyan":"#8BA59B",
    "terminal.ansiBrightGreen":"#237e02",
    "terminal.ansiBrightMagenta":"#8F4673",
    "terminal.ansiBrightRed":"#FB543F",
    "terminal.ansiBrightWhite":"#FDF4C1",
    "terminal.ansiBrightYellow":"#FAC03B",
    "terminal.ansiBlue":"#00a1f9",
    "terminal.ansiCyan":"#8BA59B",
    "terminal.ansiGreen":"#95C085",
    "terminal.ansiMagenta":"#8F4673",
    "terminal.ansiRed":"#FB543F",
    "terminal.ansiWhite":"#A89984",
    "terminal.ansiYellow":"#FAC03B"
},
Description:

To change the integrated terminal default colors you need to modify your settings in VS Code.

  1. Open the settings panel with CTRL + , or by using the File -> Preferences -> Settings menu item.
  2. Type workbench into the search field and click on the Edit in settings.json link under the Color Customization block.



  3. Insert your new color definition table:
    "workbench.colorCustomizations": {
        "terminal.background":"#131212",
        "terminal.foreground":"#dddad6",
        "terminal.ansiBlack":"#1D2021",
        "terminal.ansiBrightBlack":"#665C54",
        "terminal.ansiBrightBlue":"#0D6678",
        "terminal.ansiBrightCyan":"#8BA59B",
        "terminal.ansiBrightGreen":"#237e02",
        "terminal.ansiBrightMagenta":"#8F4673",
        "terminal.ansiBrightRed":"#FB543F",
        "terminal.ansiBrightWhite":"#FDF4C1",
        "terminal.ansiBrightYellow":"#FAC03B",
        "terminal.ansiBlue":"#00a1f9",
        "terminal.ansiCyan":"#8BA59B",
        "terminal.ansiGreen":"#95C085",
        "terminal.ansiMagenta":"#8F4673",
        "terminal.ansiRed":"#FB543F",
        "terminal.ansiWhite":"#A89984",
        "terminal.ansiYellow":"#FAC03B"
    },​

Change the prompt color

You can also change the path (prompt) color in VSCode using a PowerShell terminal. To do this you need to execute the following command in the terminal:

function prompt  
{  
    $ESC = [char]27
    "$ESC[48;2;115;75;123mPS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) $ESC[0m"  
}

The important part is this: [48;2;115;75;123m where the [48;2; is the definition prefix, 115;75;123 is the RGB color code and m is the closing tag.

The result looks like this:

Colored terminal prompt in PowerShell

You can read more about terminal colors and workbench colors on the official VSCode page. 

Share "How to change colors in VS Code integrated terminal?"
Tags:
change, modify, integrated, terminal, color, style, vs code, visual studio code
Technical term:
Change colors in VS Code integrated terminal