How to change the dark blue in wsl (Windows Subsystem for Linux) to something brighter? Here is a picture of a config file opened with vim. I basically see a black screen. I cannot read it. And the property window of the console does not allow to change specific colors. Only the background and the main text.

enter image description here

  1. Start your WSL shell (for me that is ubuntu.exe)
  2. Right-click title bar and select "Properties"
  3. Pretty dumb dialog appears where you have to follow these steps
    • select "Screen Text" and note which color box got highlighted
    • select 10th color box where the dark blue color is
    • set rgb values to 59,120,255 (or your favorite blue)
    • select the color box noted in the first step
    • press OK

That will change the color in the console palette (used for example to highlight the cwd in the PS1 prompt). However the vim screenshot you provided uses the dark blue color directly and not trough the palette. To change colors in vim see https://unix.stackexchange.com/questions/88879/better-colors-so-comments-arent-dark-blue-in-vim.

| improve this answer | |
  • While this works for changing one specific color there is an easy way to change the whole color scheme to more useful defaults. See my answer below. Just adding this note for people who don't scroll past the most voted answer ;-) – trs Jun 20 '19 at 1:17
  • 1
    You, sir, just saved the life of at least one keyboard. Thank you. – Birb Sep 25 '19 at 12:54
  • I can't believe I have gone for years trying to read that dark blue when it was this easy to fix. This answer should be selected because it precisely answers the question. (@trs I upvoted you too, but you answered a more general question) – foobarbecue Oct 23 '19 at 14:19
  • Thank you, the best solution for me without adding or installing anything else :) – Soheyl May 13 at 8:26

There is already an answer that provides a solution to this specific question (change one color of the current scheme) but Microsoft also provides a more comprehensive solution.

You can update the colour scheme to another preset and define your own schemes / presets. They made the ColorTool and it is available on github: https://github.com/Microsoft/Terminal/tree/master/src/tools/ColorTool

When you download the zip file and extract it, there may already be a built .exe hidden in a subdir somwhere (terminal\src\tools\ColorTool\ColorTool\bin\Debug\net461\) and the schemes were in a different place. For me it was

C:\Users\[username]\Documents\GitHub\terminal\src\tools\ColorTool\ColorTool\bin\Debug\net461 C:\Users\[username]\Documents\GitHub\terminal\src\tools\ColorTool\schemes

Copy both the .exe and the schemes folder to the same place and run (for example):

ColorTool.exe -b campbell.ini

That's it :-)

More info on MS dev blog: https://devblogs.microsoft.com/commandline/introducing-the-windows-console-colortool/

If you cannot find the .exe in the specified path you can try building it from source. Other people can help with that :-)

| improve this answer | |
  • this should be the answer. OneHalfDark scheme made all the colors well-contrasted and visible for me. – N K May 20 at 22:27

Change your .bashrc file in your home folder.

EX: Replace the line start by LS_COLORS by this:

export LS_COLORS

You can find more here: https://medium.com/@iraklis/fixing-dark-blue-colors-on-windows-10-ubuntu-bash-c6b009f8b97c

| improve this answer | |
  • While yes it's great that you can change ls and other programs to use a less annoying color, I think the question here was "how do you make the defined colors more readable". This does not provide a solution for 2 reasons: a) this needs to be defined for every single program and b) if for a legitimate reason another program prints blue output it will still be unreadable. – trs Jun 17 '19 at 13:18
  • Tried this, it did not work for me, but the answer from Zbyněk Winkler worked fine. This answer cannot hurt though, it does make things look generally nicer. – Contango Jun 21 '19 at 21:58

I know right. The dark blue is SO hard to read on a black background.

On my WSL instance's bash terminal it is as simple as changing one character in one file; a file you already have more likely.

Edit vim ~/.bashrc

Look for the following at about line 60.

if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;32m\]\w\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' fi

Following the then, edit the value of the PS1 variable.

Specifically changing what is for me the 89th character ...:\[\033[01;32m\]\w\... to ...:\[\033[01;33m\]\w\... will render the directory foreground text of the prompt in yellow.

Save, close vim, and the easiest way to test is to type bash<enter>. Then exit<enter> to return. Or close and reload your terminal window.

The value for this single character is the foreground color of the text that is, by enormously insightful default, dark blue on a black background.

Fun tip: The character just before this is background color of the same text.

I apologize to everyone for Microsoft's user interfering choices.

Don't forget to read the rest of the remarks in this .bashrc file. Someone obviously spent a lot of time thinking about the choices they made when constructing the file that everyone using WSL bash would have as a template.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.