This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: base-files-4.2-3 : attention maintainer


Greetings, Ken Brown!

> As long as you're updating base-files anyway, maybe you could implement
> one of the previously-discussed proposals for showing a prompt of "#" 
> instead of "$" in shells with sufficient privileges.  Unfortunately, I 
> don't remember if there was ever a consensus reached on exactly how that 
> should be done.

Something to this extent?

PS1_TAIL="$(
  x="$"
  for group in $(id -G); do 
  {
    test $group -eq 114 && { x="#"; break; }
    test $group -eq 544 && { x="#"; break; }
    test $group -eq 0 && { x="Please remove well-known SID overrides from your /etc/group file#"; break; }
  }
  done
  echo $x
  )"
if [ "$color_prompt" = yes ]; then
    PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\007\]\n$PS1_TAIL '
else
    PS1='\u@\h:\w\007\n$PS1_TAIL '
fi
unset color_prompt force_color_prompt


-- 
With best regards,
Andrey Repin
Saturday, September 26, 2015 12:07:50

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]