How to change font color of text in VSCode integrated terminal?
Asked Answered
S

2

2

I want to easily distinguish between my input commands in the VSCode terminal and the terminal output. So if I could change the colour or font of the, in my case, "my-Macbook-Air:Folder myname$", it would be very helpful.

Sample image from internet:

Image from internet

How can this be done in VSCode integrated terminal?

Season answered 17/5, 2019 at 6:17 Comment(4)
#42308449Greensward
Which terminal are you suing? bash, powershell, cmd or ? We will need this info. It can be done without editing themes.Liana
@Liana I am using bash. I am sorry I couldn't award you the bounty. I revoked the answer for now though.Season
Hmmm, usually there is a waiting period until the bounty is awarded. In any case, you don't need to award a bounty if none of the answers is helpful or accurate. Themes are not the only way to customize the terminal colors in vscode if you are using bash. You can also do it by using bash commands themselves.Liana
L
0

Look at these two sources for modifying your bash prompt - including colors:

change and color the bash prompt

change and color the bash prompt - 2

It is relatively simple to modify your bash prompt, and have it be a different color than any commands you input. You will need to know where your .bashrc or .bash_profile file is, the articles lay out the steps quite well. You can't modify the terminal font for just the prompt and not the commands though. But you can make the prompt appear bold, underlined, reversed, etc.

As an example, try

export PS1="\[\033[33m\]~/\W ==>  \[\033[m\]"

in your .bashrc file. It will change the color of the working directory and prompt to yellow.

bash prompt demo

If you need further help working through those two articles I cited, let us know.


I found these two sources for modifying a bash prompt - I like the first one:

bash prompt generator and bash $PS1 generator

Liana answered 4/6, 2019 at 4:50 Comment(6)
I believe this would change the core terminal.app's appearance. Is that embedded in VSCode too?Season
I am not sure what you mean by the core terminal. You said you were using bash - the info in my answer would only change the bash terminal's colors. It will not change vscode's built-in terminal's colors.Liana
May you please specify where to write this line in ~/.bash_profile file? it already has some content of anaconda source activationSeason
Put it at the end, so it overwrites any previous PS1 (the prompt) instruction. If you don't like it, just delete it later. Depending on your machine you will usually have to have administrator access to change the file. And you will have to reload vscode to see the changes.Liana
Hi, pestering you again, I had done it successfully, but now I need to include the virtual env in the prompt too. So may you tell the modification for (base) MacBook-Air:Desktop ankiiiii$, please? also, dont know about SO that much, shall I edit the question for including the same and request you too for editing your answer to reduce comments?Season
I am not sure what you mean by the "virtual env". gnu.org/savannah-checkouts/gnu/bash/manual/… has all the variables you can play around with. And yes, since your original question was about changing the color only you should post another question. Include the bash tagname.Liana
G
0

Color theme for VS Code integrated terminal

VSCode team have removed customizing colors from user settings page. Currently using the themes is the only way to customize terminal colors in VSCode. For more information check out issue #6766

Greensward answered 3/6, 2019 at 10:40 Comment(1)
Producing the same comment, weird that it cannot be done in the terminal, but here goes the bounty for the answer.Season
L
0

Look at these two sources for modifying your bash prompt - including colors:

change and color the bash prompt

change and color the bash prompt - 2

It is relatively simple to modify your bash prompt, and have it be a different color than any commands you input. You will need to know where your .bashrc or .bash_profile file is, the articles lay out the steps quite well. You can't modify the terminal font for just the prompt and not the commands though. But you can make the prompt appear bold, underlined, reversed, etc.

As an example, try

export PS1="\[\033[33m\]~/\W ==>  \[\033[m\]"

in your .bashrc file. It will change the color of the working directory and prompt to yellow.

bash prompt demo

If you need further help working through those two articles I cited, let us know.


I found these two sources for modifying a bash prompt - I like the first one:

bash prompt generator and bash $PS1 generator

Liana answered 4/6, 2019 at 4:50 Comment(6)
I believe this would change the core terminal.app's appearance. Is that embedded in VSCode too?Season
I am not sure what you mean by the core terminal. You said you were using bash - the info in my answer would only change the bash terminal's colors. It will not change vscode's built-in terminal's colors.Liana
May you please specify where to write this line in ~/.bash_profile file? it already has some content of anaconda source activationSeason
Put it at the end, so it overwrites any previous PS1 (the prompt) instruction. If you don't like it, just delete it later. Depending on your machine you will usually have to have administrator access to change the file. And you will have to reload vscode to see the changes.Liana
Hi, pestering you again, I had done it successfully, but now I need to include the virtual env in the prompt too. So may you tell the modification for (base) MacBook-Air:Desktop ankiiiii$, please? also, dont know about SO that much, shall I edit the question for including the same and request you too for editing your answer to reduce comments?Season
I am not sure what you mean by the "virtual env". gnu.org/savannah-checkouts/gnu/bash/manual/… has all the variables you can play around with. And yes, since your original question was about changing the color only you should post another question. Include the bash tagname.Liana

© 2022 - 2024 — McMap. All rights reserved.