0

I'm sure this is quite simple but an hour or two of searching and playing around with the .bashrc file has given me nothing.

When I first opened my terminal in Ubuntu a prompt popped up asking about formating the terminal, I selected the default and now it looks like the image below.

terminal window with strange prompt

I want to know how I can remove the highlighting of the username part.

2
  • are you sure that is bash? it looks like zsh... in which case .bashrc will have no effect on it for obvious reasons XD try .zshrc instead...
    – Zanna
    Jun 26, 2017 at 21:49
  • Hello, I had changed the PS1 variable in .bashrc but you are right this fix in .bashrc didn't change the look of the terminal. Can you suggest any changes to make to .zscrc?
    – whathits
    Aug 16, 2017 at 13:03

1 Answer 1

0

You have probably messed up the variable $PS1. This formats the prompt (not only in the gnome-terminal window, but in any terminal emulator). The default value for $PS1 is:

\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$

Simply assign this line to the variable PS1:

PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$"

and your prompt should look normal again.

If you're happy with how it looks, put this statement in your ~/.bashrc file:

export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$"
3
  • the default .bashrc contains lines to set PS1... I recommend correcting those lines rather than adding a new export line (having screwed up my PS1 every which way for science)
    – Zanna
    Jun 26, 2017 at 21:36
  • Thanks for your answer but using the above changes didn't change the look of the terminal and gave me this when I opened the terminal. zsh compinit: insecure directories, run compaudit for list. Ignore insecure directories and continue [y] or abort compinit [n]? Which I fixed using this solution stackoverflow.com/questions/13762280/…
    – whathits
    Aug 16, 2017 at 13:01
  • So it was zsh, as Zanna suggested, not bash.
    – Jos
    Aug 16, 2017 at 13:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .