0

I have created 2 profiles for gnome-terminal. One is meant to be green-on-black, the other is meant to be red-on-black. They do change some of the terminal colors, but my prompts remain bright bold green. Is there a way to force the prompt to use the profile colors?

FWIW, I'm using Xubuntu 16.04

Thanks.

1 Answer 1

2

Whoops,

Just seen the prompt color is hard-coded in ~/.bashrc. How embarrassing.

I changed the prompt from this:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

to this:

PS1='${debian_chroot:+($debian_chroot)}\[\033[1m\]\u@\h:\w\$ \[\033[0m\]'

And that did the trick.

2
  • Actually, that code has issues w/ line-wrapping. An easier way to do it would be PS1='${debian_chroot:+($debian_chroot)}\[$(tput bold)\]\u@\h:\w\$ \[$(tput sgr0)\]' Jul 5, 2016 at 7:18
  • I fixed it for you
    – wjandrea
    Sep 11, 2017 at 4:39

You must log in to answer this question.

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