From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11679 invoked from network); 18 Oct 2001 00:58:24 -0000 Received: from unknown (HELO sunsite.dk) (130.225.247.90) by ns1.primenet.com.au with SMTP; 18 Oct 2001 00:58:24 -0000 Received: (qmail 5830 invoked by alias); 18 Oct 2001 00:58:12 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4389 Received: (qmail 5818 invoked from network); 18 Oct 2001 00:58:10 -0000 From: Bart Schaefer Message-Id: <011017175757.ZM5134@candle.brasslantern.com> Date: Wed, 17 Oct 2001 17:57:57 -0700 In-Reply-To: <20011018011512.C17952@greux.loria.fr> Comments: In reply to Vincent Lefevre "Re: Problem with zip completion" (Oct 18, 1:15am) References: <20011017164751.A6245@greux.loria.fr> <20011017111333.A32235@dman.com> <20011017182121.A6958@greux.loria.fr> <1011017164932.ZM4674@candle.brasslantern.com> <20011017191154.B17322@greux.loria.fr> <1011017172404.ZM4733@candle.brasslantern.com> <1011017174447.ZM4784@candle.brasslantern.com> <20011018011512.C17952@greux.loria.fr> X-Mailer: Z-Mail Lite (5.0.0 30July97) To: Vincent Lefevre , zsh-users@sunsite.dk Subject: Re: Problem with zip completion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 18, 1:15am, Vincent Lefevre wrote: > Subject: Re: Problem with zip completion > On Wed, Oct 17, 2001 at 17:44:46 +0000, Bart Schaefer wrote: > > Actually, having given it a moment's more thought, it would probably be > > better to use > > > > TRAPCLD() { [[ -t 0 ]] && precmd } > > > > or even > > > > TRAPCLD() { [[ -o interactive && -t 0 ]] && precmd } > > Why? If TRAPCLD is called when stdout is redirected (thus, not necessarily > attached to a tty), I still want to be able to write to the tty (here, to > change the terminal title). It depends on where and how you're defining the TRAPCLD function, I guess. My assumption would be that if stdout is redirected, then the child that's exiting must not be a child of the top-level interactive shell, and thus changing the terminal title would at best be a waste of effort. Remember, it's the stdout of the *parent* of the exiting job that we're testing here.