My WSL terminal lost color

Posted on Apr 17, 2022

Question

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

Answer

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: