0

I tried to change the color of code output which redirected to zsh integrated terminal at VS Code (macOS)but with no result. It's quite simple to change the Theme in settings or only text/background/cursor color but it's quite challenging to change only colour of code output (I want to do this in order to make it easier to see where is output of my script and where is terminal data).

Firstly I tried this at settings.json:

"terminal.integrated.shellArgs.windows": [
     "-dumb", 
     "-c", 
     "echo -e '\\e[31m'"
]

But VS Code told me:

This is now deprecated. recommendation tells: 'the new recommended way to configure your default shell is by creating a terminal profile in terminal.integrated.profiles.windows and setting its profile name as the default in terminal.integrated.defaultProfile.windows. This will currently take priority over the new profiles settings but that will change in the future.`

Next step was trying this:

"zsh": {
     "path": "zsh",
     "args": [
         "-l",
         "echo '\u001b[31m'"
     ]
}

But I got this error:

The terminal process "/bin/zsh '-l', 'echo '[31m''" failed to launch (exit code: 127).

I know that it's possible to use such constructions in the code

print("\033[34mHello, world!\033[0m")

but... Is it possible to set up VS Code?

rioV8
  • 24,506
  • 3
  • 32
  • 49
Sanny Wind
  • 21
  • 5
  • you can customize the theme terminal colors by theme – rioV8 Mar 15 '23 at 19:48
  • 1
    Does this answer your question? [Color theme for VS Code integrated terminal](https://stackoverflow.com/questions/42307949/color-theme-for-vs-code-integrated-terminal) – starball Mar 15 '23 at 22:16

1 Answers1

0

Open the VS Code settings by pressing Command +. After that, search for "Terminal > Integrated > Ansi" in the search bar. In the "Ansi" section, you will find options to change the colors for different terminal outputs like "ansiBrightGreen", "ansiRed", "ansiYellow", etc. You can change the value of these options to the desired color code in HEX format. For example, if you want to change the color of the output to red, you can set "ansiRed" to "#FF0000". If the changes do not apply, try restarting the terminal.

paffosx
  • 86
  • 4
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 21 '23 at 02:18