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: Bashrc distinguish between mintty and x-windows xterm


==== Fri, May 25, 2012 at 09:32AM -0400 Buchbinder, Barry (NIH/NIAID) [E] wrote:
> Andrew Hancock sent the following at Friday, May 25, 2012 12:42 AM
> >Barry, it works flawlessly. Thanks immensely!
> 
> But I forgot to export ThisTerm, otherwise it is always unset when
> a subshell is launched.

Access to the /proc file system is fast, so you could forgo the
variable and access it directly:

case "$(< /proc/$PPID/exename)" in
    */xterm)  echo "This is an xterm" ;;
    */mintty) echo "This is a mintty" ;;
esac

I don't have a need for this, but I had wondered how I would do it
if I did.  So I'm glad you posted this.

-Ken Jackson

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