Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My WSL terminal lost color

For some reason when I start the Ubuntu terminal in Windows, it doesn't show colors until I type bash. What could be the reason and how do I fix it? When I installed WSL it always showed colors.

enter image description here

like image 439
Thijs Avatar asked Feb 13 '18 07:02

Thijs


People also ask

How do I change my WSL terminal theme?

Open the terminal, right click on top and go to Options, Looks and finally change the Theme. Here you can choose whichever one you feel like, but base16-solarized-dark.

How do you show colors in terminal?

Your problem is that most probably colored output is disabled in your terminal. Then go in your Terminal settings -> Preferences -> Profiles -> Text -> Display ANSI colors. Open a new terminal and you should be ready to go!


1 Answers

The reason could be a modified .bash_profile file. Try putting these lines to ~/.bash_profile

source ~/.bashrc 

Or a better way is to run the below command from your terminal

echo "source ~/.bashrc" >> ~/.bash_profile 

To know more about how do we set environment-variables and what role do files like .bashrc, .bash_profile play, you may want to read:

  • .profile or .bash_profile
  • How to create ~/.bash_profile and ~/.profile
  • I cannot find .bash_profile in ubuntu
like image 66
Akash Mahapatra Avatar answered Oct 05 '22 18:10

Akash Mahapatra