From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2466 invoked from network); 18 Oct 2005 22:47:39 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Oct 2005 22:47:39 -0000 Received: (qmail 54881 invoked from network); 18 Oct 2005 22:47:29 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Oct 2005 22:47:29 -0000 Received: (qmail 23689 invoked by alias); 18 Oct 2005 22:47:22 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9513 Received: (qmail 23674 invoked from network); 18 Oct 2005 22:47:21 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 18 Oct 2005 22:47:21 -0000 Received: (qmail 53769 invoked from network); 18 Oct 2005 22:47:21 -0000 Received: from tantale.fifi.org (64.81.251.130) by a.mx.sunsite.dk with SMTP; 18 Oct 2005 22:47:19 -0000 Received: from ceramic.fifi.org (Debian-exim@ceramic.fifi.org [64.81.251.131]) by tantale.fifi.org (8.9.3p2/8.9.3/Debian 8.9.3-21) with ESMTP id PAA23430; Tue, 18 Oct 2005 15:47:14 -0700 Received: from phil by ceramic.fifi.org with local (Exim 4.34) id 1ES0Ek-0000pQ-MA; Tue, 18 Oct 2005 15:47:14 -0700 To: DervishD Cc: Zsh Users Subject: Re: How to "STTY" when "setopt nointeractive"? References: <20051018191756.GA407@DervishD> Mail-Copies-To: nobody From: Philippe Troin Date: 18 Oct 2005 15:47:14 -0700 In-Reply-To: <20051018191756.GA407@DervishD> Message-ID: <87ek6ixx1p.fsf@ceramic.fifi.org> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 DervishD writes: > Hi all :) > > In a shell script, this command: > > STTY=-onlcr stty -a > > doesn't have the desired effect (it doesn't deactivate onlcr). It > has to do with the INTERACTIVE option, because if the bangpath in the > script is "#!/bin/zsh -i" instead of the usual "#!/bin/zsh", it > works. Is it my fault,a desired behaviour or a bug? I guess the STTY special environment variable has no effect if interactive is not set. > I was testing Bart's suggestion for my problematic "zpty" command > and I found that, after succesfully testing in the command line, it > didn't work in the script. I tried to change a couple of options that > may be slightly related with the terminal but it was "INTERACTIVE" > who made it work. Since I cannot "setopt interactive" within a > script, the only way is to change the bangpath. Why not simply: stty -onlcr in your script? If you're worried about resetting the terminal state on exit (which you shouldn't in a zpty session), you always can: savedstty='' trap 'stty $savedstty' EXIT savedstty=$(stty -g) stty -onlcr Phil.