Bug 139628 - RFE: colors for bash prompts
Summary: RFE: colors for bash prompts
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: 3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-11-17 00:20 UTC by Rahul Sundaram
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-12-09 12:22:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.



Note You need to log in before you can comment on or make changes to this bug.