This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Bashrc distinguish between mintty and x-windows xterm
- From: Andrew Hancock <andymhancock at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Fri, 25 May 2012 00:41:54 -0400
- Subject: Re: Bashrc distinguish between mintty and x-windows xterm
- References: <CAGU3OVyzt3r+raKuFEnb1AKkqfzHQy1DPFukJSU8mQyR_3gr9g@mail.gmail.com>
Buchbinder, Barry (NIH/NIAID) [E] <BBuchbinder <at> niaid.nih.gov> writes:
>
> # Only set ThisTerm if not set.
> if [ -z "${ThisTerm}" ]
> then
>?? if [ ${PPID} = 1 ]
>?? then
>???? ThisTerm=cmd
>?? else
>???? if [ "$(cat /proc/${PPID}/exename)" = '/usr/bin/mintty' ]
>???? then
>?????? ThisTerm=mintty
>???? else
>?????? # not minty, not cmd, so xterm
>?????? ThisTerm=xterm
>???? fi
>?? fi
> fi
>
> Then set colors by the value of ThisTerm.
Barry, it works flawlessly.? Thanks immensely!
--
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