I would like the CasebashMac:bfgenv chris$
part of the following line to appear in a different color in my terminal.
CasebashMac:bfgenv chris$ python
I would like the CasebashMac:bfgenv chris$
part of the following line to appear in a different color in my terminal.
CasebashMac:bfgenv chris$ python
I set the PS1 variable in my .bashrc
to achieve this.
[editorofchoice] ~/.bashrc
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
.bashrc
The terminal app does not actually change the colours, this is controlled by the shell that is being run. The default shell is bash and controlling colours is done by altering the prompt. There are many tutorials and other documents on the web to tell you more.
One guide to customising the prompt is from IBM
CasebashMac:~ chris$ cat ~/.bashrc PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
– Casebash Oct 17 '10 at 20:04.bashrc
on my machine. The actual PS1 line I got from my Ubuntu Server since I wanted both to be the same. Also make sure you exit both the terminal and quit terminal and then reopen. – BinaryMisfit Oct 18 '10 at 09:07.bashrc
. I have double checked on my side and it is correct. I am not very clued up on how it works, I really just applied what I know about Linux to get it to work for me since the rules are the same. I am not sure why it's not working in your case. – BinaryMisfit Oct 19 '10 at 07:01