X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.4 required=5.0	tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW
X-Spam-Check-By: sourceware.org
Message-ID: <4D711B41.3030601@cpan.org>
Date: Fri, 04 Mar 2011 12:02:57 -0500
From: Rafael Kitover <rkitover@cpan.org>
Reply-To: rkitover@cpan.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.14) Gecko/20110221 Thunderbird/3.1.8
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Detect mintty in .zshrc?
References: <4D6F690F.9010100@cpan.org>	<AANLkTimSwLjFOPk=v7HKfzjm1hdv+4MWfNBPEVYfsGbD@mail.gmail.com>	<4D6FDE68.8040705@cpan.org> <AANLkTi=uYO0M0FNk6RJKoeDsEUz5PtwNjw5FogsGzdvQ@mail.gmail.com>
In-Reply-To: <AANLkTi=uYO0M0FNk6RJKoeDsEUz5PtwNjw5FogsGzdvQ@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 3/4/2011 7:26 AM, Andy Koppe wrote:
> On 3 March 2011 18:31, Rafael Kitover wrote:
>> 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.
> 
> How come you need to guard against TERM==dumb? Cygwin shouldn't set it to that.

When I installed SUA (and haven't played with it yet) it for some reason
set TERM=dumb in my control panel env vars. Cygwin apparently only sets
it to 'cygwin' if it's initially unset, which makes sense.

In addition, the native Perl readline implementation only turns on if
TERM is unset or is set to 'dumb', for some reason, so I have aliases in
my .zshrc to run scripts with TERM=dumb where I want the readline to be
on for ActivePerl/Strawberry.

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

