In terminal, the usual prompt text user@machine isn't green/blue as usual. Instead is is just white like the rest of the text. If I ssh into my server however, the colours are the same. Perhaps I've accidentally hit a button?
The settings in Edit → Profile Preferences → Colors look fine. The selected palette shown there is Linux Console.
I've tried using apt remove gnome-terminal && apt install gnome-terminal but that still hasn't worked. I've also tried using the MATE Terminal method and using UXTerm but both of which are doing the same issue.
6 Answers
I ran into this issue when I accidentally deleted my ~/.bashrc file. Changing the Profile Preferences as stated in a comment above did not work. Since I completely lost my ~/.bashrc file, I simply copied /etc/skel/.bashrc to ~/.bashrc. After a logout and login, my terminal colors were back to normal.
One could also look at /etc/skel/.bashrc to see if anything related to color is missing from their ~/.bashrc file.
This may not be the solution to OP's exact problem but I hope it helps somebody.
2I think you delete your .bashrc file, so you can use this command:
cp /etc/skel/.bashrc ~/ 0 I copied /etc/skel/.bashrc to ~/.bashrc
then source .bashrc
and terminal Color restored!
1For me i was using lxterminal in lubuntu and the color for the user@machine not working. I had to uncomment force_color_prompt=yes in ~/.bashrc to make the geen colour appear
It might also have to do with color_prompt variable which is defined in the ~/.bashrc file. The block responsible for defining the color scheme is :
if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fiJust try peeking at its value by adding echo $color_prompt before the above block. If it is not "yes", then now you can overwrite the value as @plettech has suggested.
Also, just running source ~/.bashrc can sometimes help as well.
Open up ~/.bashrc
And enter on a line by itself:
color_prompt=yesworked for me