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

Local traps again: This is useful, but is it correct?



One can bypass the "locatraps" option by creating a TRAPxxx function, e.g.
the function remains defined after endtrapscope() but a trap created with
`trap ... xxx' is removed.

This is one of two reasons that Functions/Prompts/promp_bart_setup uses an
assignment to the functions assoc to install a SIGWINCH handler, so I'm not
sure I advocate changing it; but it at least ought to be mentioned in the
doc under LOCAL_TRAPS.

For completeness, I should point out that the TRAPxxx defintion only wins
if there IS NOT already a trap for signal xxx at some higher scope.  So it
does behave somewhat inconsistently.

I was about to doublecheck on what happens with `trap ... xxx' in that last
situation, but zsh just crashed again, so I'm going to quit fooling with
signals until Sven comes back online.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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