1
This is mainly to change the prompt for elevated shells in Cygwin.
I need to know a fast command of either Windows or Cygwin that tells me whether i'm elevated in Windows 7.
1
This is mainly to change the prompt for elevated shells in Cygwin.
I need to know a fast command of either Windows or Cygwin that tells me whether i'm elevated in Windows 7.
1
As stated here it's done with the help of Cygwin's command id
:
id -G | egrep -q '\<544\>' && set prompt = '# || set prompt = '\$ '
Or in my case with bash
i added this to the end of /etc/bash.bashrc
(Note that I removed the \n
that comes in default prompt):
id -G | egrep -q '\<544\>' &&
PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]# ' ||
PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\$ '