Bug 139628

Summary: RFE: colors for bash prompts
Product: [Fedora] Fedora Reporter: Rahul Sundaram <rahulsundaram>
Component: bashAssignee: Tim Waugh <twaugh>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-12-09 12:22:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rahul Sundaram 2004-11-17 00:20:43 UTC
Description of problem:


Version-Release number of selected component (if applicable):

steps

Stick it at the end of /etc/bashrc

if [ `id -un` = root ]; then

PS1='\[\033[1;32m[\033[1;35m\]\u@\h\W\[\033[1;32m]\033[1;32m\]\$\[\033[1;0m\]'
else

PS1='\[\033[1;32m[\033[1;36m\]\u@\h\W\[\033[1;32m]\033[1;32m\]\$\[\033[1;0m\]'
fi

root prompts and non root prompts are not differentiated with colors. 
  
Actual results:

root prompts and non root prompts are not differentiated with colors.
this would be especially be useful for desktop systems and home users
to warn them that root usage is privelaged

Expected results:

It should use colors to differentiate prompts

Additional info:

credit:rank AT pineaus.com

Comment 1 Tim Waugh 2004-12-08 16:10:05 UTC
No colour scheme will please everyone, but at the very least it should be
something simpler!  All red, for instance, for a root login.

Comment 2 Rahul Sundaram 2004-12-08 16:59:19 UTC
Hey

That was just an example. Go ahead and implement a more simple mechanism. All I
am suggesting is a simple method to differentiate between root and normal user
accounts

Comment 3 Tim Waugh 2004-12-08 17:19:11 UTC
See fedora-devel-list discussion:

https://www.redhat.com/archives/fedora-devel-list/2004-December/msg00278.html

Comment 4 Tim Waugh 2004-12-09 12:22:34 UTC
I think David Woodhouse's objection is most succinct:

  If the  user is unaware of the distinction and the danger of doing things as
  root, changing the colour of the prompt isn't going to help. If the user
  _is_ aware of the difference, then the standard $/# indicator is
  sufficient.