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

Re: Interrupting globs (Re: Something rotten in tar completion)



On Dec 5,  2:50pm, Peter Stephenson wrote:
} Subject: Re: Interrupting globs (Re: Something rotten in tar completion)
}
} > This seems to help:
} > 
} > diff --git a/Src/glob.c b/Src/glob.c
} > index ca7bc44..b3903f2 100644
} > --- a/Src/glob.c
} > +++ b/Src/glob.c
} > @@ -463,7 +463,7 @@ scanner(Complist q, int shortcircuit)
} >      int errssofar = errsfound;
} >      struct dirsav ds;
} >  
} > -    if (!q)
} > +    if (!q || errflag)
} >  	return;
} >      init_dirsav(&ds);
} 
} Not for me: it's more basic than that.  The trap in _main_complete isn't
} working *at all* --- or, rather, it's working too well, by trapping all
} errors.

Not speaking directly for completion, but withOUT the above patch:

% : /**/*(/)

is not interruptible.  WITH the above patch, the recursive glob can be
interrupted.
 
} It's using an eval-style trap, so the "return" in it is forcing the
} current function in the completion code to return with that status and
} no error flagged.

That was actually intentional based on the behavior complaint that led
to the trap being added.  Changing the type of trap addresses a slightly
different problem.  What we need is some way to get both.



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