Bug 284565

Summary: Only have the hostname as red for the root bash prompt
Product: [openSUSE] openSUSE 10.3 Reporter: Francis Giannaros <francis>
Component: OtherAssignee: Dr. Werner Fink <werner>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P5 - None    
Version: Alpha 5   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Francis Giannaros 2007-06-15 00:21:23 UTC
The new prompt for the root user makes the hostname and directory location all-red. I like the fact that red is used here, as it makes it clearer when you're logged in as root, but putting the whole prompt as red is perhaps a little too much. How about just having the hostname as red?

In a similar vein, how about changing it around a little more altogether? My suggestion: have the time as a light grey, a normal username in green, and the directory location as blue. This ensures that all the information (like the time and hostname) are still there, but they're not as prominent (since the grey puts it into the background). Different colours helps you more immediately differentiate the appropriate information. So, something like:

PS1='\[\e[37m\]\A \[\e[32m\]\u\[\e[0;37m\]@\h\[\e[37m\]:\[\e[0;34m\]\w\[\e[0m\]> ';
..for the user, and:
PS1='\[\e[37m\]\A \[\e[31m\]\u\[\e[0;37m\]@\h\[\e[37m\]:\[\e[0;34m\]\w\[\e[0m\]> ';
...for root.

Which ends up looking something like: http://francis.giannaros.org/screenshots/bashprompt.png

Personally I don't find the hostname information useful at all (even though I do ssh around) so I omit the hostnames on a lot of prompts I use altogether. 

Even if the idea above isn't adopted, perhaps some of it could be (like having a normal user as green). 

Any thoughts?
Comment 1 Dr. Werner Fink 2007-06-18 09:10:12 UTC
Sorry, I'll not do this simply because I do not know about the
coloring used within the terminal its self, the wrong background
color and some part are not visible anymore.
Comment 2 Francis Giannaros 2007-06-18 10:36:31 UTC
Could you expand a little more? Which colours do you mean? At the very least changing the colour of $PWD in the prompt (so that it's not red, only the hostname is) can't cause extra colour issues, so what do you mean?
Comment 3 Dr. Werner Fink 2007-06-18 10:45:22 UTC
The background and foreground colors which users uses within e.g. GNOME terminal
or KDE konsole or simply xterm. Please keep in mind that coloring depends highly
on the users preferences. On reason why I'll not touch this.  But you're
welcome to use /etc/bash.bashrc.local for you're own preferences.