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

Re: trap question

On 2022-11-25 17:57, Bart Schaefer wrote:
remain un-expandable within single quotes. Is this an exception or
somehow to be viewed as routine?
You can think of "trap" as a delayed "eval".
Ok, so I can continue to expect that there's no expansions within single quotes.  It's sorta intuitive that a trap is a special case.

BTW, will this trap catch exiting
errors or just proper returns?
Depends on the error.  If you have "setopt err_exit" (or err_return)
then the trap will be tripped when something returns false,

I have that off by default, sounds like it should be on.  Thing is that this is for a function that uses zcurses and if it quits before cleaning up after itself ...  it's quite remarkable how many different things might go wrong when zcurses still wants to be in charge.  So I'm hoping the trap -- which does all the cleanup -- will be sprung after any internal error as well as controlled exits.  Mind that's luxurious if it can do it, I know how to mop up elsewise.

BTW, speaking of zcurses, I see nothing in the doc, but is there a way to list open windows?

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