22

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.

Eliah Kagan
  • 119,640

6 Answers6

27

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 like this:

cp /etc/skel/.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.

sotirov
  • 4,379
kjpc-tech
  • 486
14

I think you delete your .bashrc file, so you can use this command:

cp /etc/skel/.bashrc ~/
9

I copied /etc/skel/.bashrc to ~/.bashrc

then source .bashrc

and terminal Color restored!

damadam
  • 2,873
Bou Said
  • 121
3

For 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

ptetteh227
  • 2,044
1

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\$ '
fi

Just 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.

1

Open up ~/.bashrc

And enter on a line by itself:

color_prompt=yes

worked for me