Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Problem with zip completion



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.



Messages sorted by: Reverse Date, Date, Thread, Author