20

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
  • 117,780
  • 3
    "Edit > Profile Preferences > Colors" and look at the selected "Palette". – Elliott Frisch May 18 '16 at 22:13
  • It seems fine. The palette is Linux Console – runnerbeany May 19 '16 at 08:35
  • what about XTerm ? if the problem only on terminal try to reinstall http://askubuntu.com/questions/684180/how-to-reinstall-gnome-terminal – Mohamed Slama May 19 '16 at 11:00
  • 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. – runnerbeany May 19 '16 at 16:15
  • may you reinstall but preferences still saved try to reset preferences third and fourth answers http://askubuntu.com/questions/14487/how-to-reset-the-terminal-properties-and-preferences and please make a mention when you replay – Mohamed Slama May 19 '16 at 22:08
  • if reset not working install new terminal instead of gnome like this http://linuxg.net/how-to-install-guake-terminal-and-guake-indicator-on-ubuntu-14-04-trusty-tahr-and-ubuntu-13-10-saucy-salamander/ – Mohamed Slama May 20 '16 at 21:31
  • @MohamedSlama as I said, the colours are fine if I ssh into my file server but if I ssh into the laptop the colours go – runnerbeany May 20 '16 at 21:34
  • @MohamedSlama this is it http://imgur.com/ptyShAm – runnerbeany May 26 '16 at 09:48

6 Answers6

26

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
  • 3,169
kjpc-tech
  • 476
13

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

cp /etc/skel/.bashrc ~/
8

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

then source .bashrc

and terminal Color restored!

damadam
  • 2,833
Bou Said
  • 111
  • 2
    for more clarification about this issue ( in my experience) the issue is back after restart ,So I have fixed this by deleting .bash_profile and using .profile instead basedإ on this response : https://askubuntu.com/questions/517677/how-do-i-get-a-colored-bash – Bou Said Dec 18 '19 at 00:38
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
  • 1,904
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

AndreGraveler
  • 151
  • 1
  • 1
  • 6