From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8269 invoked by alias); 25 May 2012 13:34:26 -0000 Received: (qmail 8085 invoked by uid 22791); 25 May 2012 13:34:26 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,SPF_HELO_PASS,TW_HR,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nihxway2out.hub.nih.gov (HELO nihxway2out.hub.nih.gov) (128.231.90.110) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 May 2012 13:33:53 +0000 X-IronPortListener: Outbound_SMTP X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhAFAPSIv0+cKEcU/2dsb2JhbABFsUiDW4EHghYBAQQSKE8CAQgNJwIQHxMlAQEEARoah2ueaJxQiwGEZmADjHmOEIl/gnw Received: from unknown (HELO NIHHT01.nih.gov) ([156.40.71.20]) by nihxway2out.hub.nih.gov with ESMTP; 25 May 2012 09:33:47 -0400 Received: from NIHMLBX02.nih.gov ([156.40.71.32]) by NIHHT01.nih.gov ([156.40.71.20]) with mapi; Fri, 25 May 2012 09:32:51 -0400 From: "Buchbinder, Barry (NIH/NIAID) [E]" To: "cygwin@cygwin.com" , Andrew Hancock Date: Fri, 25 May 2012 14:19:00 -0000 Subject: RE: Bashrc distinguish between mintty and x-windows xterm Message-ID: <0105D5C1E0353146B1B222348B0411A20A770C7EF3@NIHMLBX02.nih.gov> References: In-Reply-To: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2012-05/txt/msg00572.txt.bz2 Andrew Hancock sent the following at Friday, May 25, 2012 12:42 AM >Barry, it works flawlessly. Thanks immensely! You are very welcome. But I forgot to export ThisTerm, otherwise it is always unset when a subshell is launched. # Only set ThisTerm if not set. if [ -z "${ThisTerm}" ] then if [ ${PPID} =3D 1 ] then ThisTerm=3Dcmd else if [ "$(cat /proc/${PPID}/exename)" =3D '/usr/bin/mintty' ] then ThisTerm=3Dmintty else # not minty, not cmd, so xterm ThisTerm=3Dxterm fi fi export ThisTerm fi One could test exename for /usr/bin/xterm instead of assigning by the process of elimination. - Barry Disclaimer: Statements made herein are not made on behalf of NIAID. -- 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