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

Can periodic hook stop rescheduling?



Hello,
I'm using sched to call a function. The problem is, it sometimes
doesn't reschedule. sched +2 is the first line of the scheduled
function, however I observed, that when running a completion and
pressing Ctrl-C to abort something in it (when using
:completion:*:*:*:default' menu yes select search) this Ctrl-C might
somehow apparently reach scheduled function and block reschedule. I've
added a protection via preexec hook – I check when scheduled function
did last run and reschedule when a delay is detected.

I thought about adding such protection via periodic hook. The question
is: is it fully robust? Doc says that error in precmd will stop
periodic function, however it isn't clear about next expected run of
it:

"Note further that an error in a precmd hook causes an immediately
following periodic function not to run (though it may run at the next
opportunity). "

So, is the reschedule of periodic fully robust, or is it possible that
error in precmd (and maybe Ctrl-C press) will block reschedule?
(blocking single run is fine)

Best regards,
Sebastian Gniazdowski



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