Change font color settings in Ubuntu terminal on WSL

Table of Contents

I found it difficult to see some of the colors of the terminals on WSL2 Ubuntu 18.04LTS on Windows 10 Pro. So you can customize the text color.

Install Windows Terminal

Install from Microsoft Store. Register in the start menu.

Start Windows Terminal

Start Windows Terminal from the Start menu, then Windows PowerShell terminal will be launched. Click on the downward-facing symbol to the right of the "+" on the right of the tab to open the menu.

Click on Settings in the menu, edit it (Append "colorScheme": "One Half Dark",) as follows:

{
    "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
    "hidden": false,
    "name": "Ubuntu-18.04",
    "colorScheme": "One Half Dark",
    "source": "Windows.Terminal.Wsl"
},

Color setting using dircolors

Apart from Windows Terminal, the environment variable LS_COLORS can be set using dircolors.

Create a setting file

Save a file that contains the current settings in the home directory.

dircolors -p > ~/.dircolors

Open the created .dircolors with editor and edit it. As an example, the Windows folder is hard to see, so change the values as follows:

DIR 01;36 # directory
LINK 01;32 # symbolic link. (If you set this to 'target' instead of a  

OTHER_WRITABLE 01;36 # dir that is other-writable (o+w) and not sticky

Edit .bashrc

Open the .bashrc file with editor; append the following:

eval $(dircolors -b ~/.dircolors)

When you restart the terminal, the color has been changed.

One thought on “Change font color settings in Ubuntu terminal on WSL

  1. Yih Chuang says:

    Thank you so much for the sharing. As a color-blind person, this post is truly helpful.

Leave a Reply to Yih Chuang Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.