Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Switch Terminal colors per user' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Switch Terminal colors per user
Authored by: koncept on Dec 28, '04 03:22:17PM
This is my prompt.. Aqua coloured..

// appears as [user@host:/path]$ 
declare -x PS1="\[\033[0;36m\][\u@\h:\w]$\[\033[0m\] "


[ Reply to This | # ]
Switch Terminal colors per user
Authored by: gshenaut on Dec 28, '04 05:41:31PM

Yeah, but the hard part is to change the color when changing the user, and then to restore the original color when changing back to the previous user.

Greg Shenaut



[ Reply to This | # ]
Switch Terminal colors per user
Authored by: guybrush on Dec 29, '04 05:48:40AM
This is mine:

[guybrush@powerbook guybrush]$ echo $PS1
\[\033[35m\][\[\033[36;1m\]\u\[\033[0;36m\]@\[\033[1m\]\h \[\033[33m\]\W\[\033[0;35m\]]\[\033[0m\]$
looks best on a black background Terminal ;)

[ Reply to This | # ]
Switch Terminal colors per user
Authored by: Darkshadow on Dec 29, '04 08:33:22PM

Hmm, if y'all are using bash (or sh), you can use \e instead of \033.

This is how my prompt works... output's a bit different, but then I'm a bit different. ;)

\[\e[1m\]\[\e[37m\]<\[\e[36m\]\u\[\e[37m\]://\[\e[33m\]\h/\W.htm\[\e[37m\]>\[\e[0m\] \[\e[37m\]\$

(output as <user://host/last_component_cwd.htm> $ )



[ Reply to This | # ]
Switch Terminal colors per user
Authored by: Thomas Riise on May 19, '05 05:26:24AM
I also have a quite simple env defined in .profile for various users - with colors and everything:

Example:
PS1='\e[0;36m${PWD}:\e[m\] '
export PS1


e.g. RED is smart when you're logged in as root etc...



---
An Apple a day keeps Microsoft away...

[ Reply to This | # ]