delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/05/25/00:42:19

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_HR
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <CAGU3OVyzt3r+raKuFEnb1AKkqfzHQy1DPFukJSU8mQyR_3gr9g@mail.gmail.com>
References: <CAGU3OVyzt3r+raKuFEnb1AKkqfzHQy1DPFukJSU8mQyR_3gr9g AT mail DOT gmail DOT com>
Date: Fri, 25 May 2012 00:41:54 -0400
Message-ID: <CAGU3OVwL-69=3pN=4dgCEamQnd5VnnCPRpi-grpO-ciUgTrnuw@mail.gmail.com>
Subject: Re: Bashrc distinguish between mintty and x-windows xterm
From: Andrew Hancock <andymhancock AT gmail DOT com>
To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q4P4gFxC020400

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019