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: Detect mintty in .zshrc?


On 3/3/2011 7:21 AM, Andy Koppe wrote:
> On 3 March 2011 10:10, Rafael Kitover wrote:
>> I was wondering if there's a way in my .zshrc to determine if the shell
>> is running in mintty or in a regular windows console.
> 
> Check $TERM. It defaults to 'xterm' in mintty and 'cygwin' in the console.
> 
> Andy

Thank you, that works for me, I put this block at the top of my .zshrc:

if [ "$TERM" = "cygwin" -o "$TERM" = "dumb" ]; then
  export RUNNING_IN_CONSOLE=1
  export TERM=cygwin
fi

later I switch on "$RUNNING_IN_CONSOLE" to see if I'm in a real console.

--
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]