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


Solution 1:

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

Solution 2:

In your .bashrc, try uncommenting the following line in order to force color:

#force_color_prompt=yes