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?

  • 1
    https://stackoverflow.com/questions/42307949/color-theme-for-vs-code-integrated-terminal – Janneck Lange Jun 03 '19 at 10:39
  • Which terminal are you suing? bash, powershell, cmd or ? We will need this info. It can be done without editing themes. – Mark Jun 04 '19 at 01:32
  • @Mark I am using bash. I am sorry I couldn't award you the bounty. I revoked the answer for now though. –  Jun 04 '19 at 04:24
  • 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. – Mark Jun 04 '19 at 04:53

2 Answers2

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

Janneck Lange
  • 882
  • 2
  • 11
  • 34
  • 1
    Producing the same comment, weird that it cannot be done in the terminal, but here goes the bounty for the answer. –  Jun 03 '19 at 20:43
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

Mark
  • 143,421
  • 24
  • 428
  • 436
  • I believe this would change the core terminal.app's appearance. Is that embedded in VSCode too? –  Jun 04 '19 at 04:51
  • 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. – Mark Jun 04 '19 at 04:54
  • May you please specify where to write this line in ~/.bash_profile file? it already has some content of anaconda source activation –  Jun 04 '19 at 05:06
  • 1
    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. – Mark Jun 04 '19 at 05:13
  • 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? –  Aug 17 '19 at 18:31
  • I am not sure what you mean by the "virtual env". https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Controlling-the-Prompt 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. – Mark Aug 17 '19 at 19:37