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

[ramk@xxxxxxxxxxxxxxxxx: Bug#335481: zsh: zsh/sched waits for next return to prompt even with NOTIFY set]



----- Forwarded message from "R.Ramkumar" <ramk@xxxxxxxxxxxxxxxxx> -----

The sched builting provided by the zsh/sched module seems to execute
a scheduled command only when an enter is pressed after the time
specified has elapsed/arrived, much like how mail notification
occurs. This makes the command useless when the user wants to
schedule and leave the shell idle, and start using it only after the
time for which the command is scheduled. I don't know if this is a
bug or it is the intended behaviour. If it is intended, I could
suggest a few alternatives that would add this feature.

1. Execute as soon as the time arrives (maybe in the background),
   much like how job exit notification works with the NOTIFY option
   works. May be sched can reuse this option or have an option of
   its own. Or even better, perhaps one can indicate the desired
   behaviour on a per-item basis, by a flag, when adding an item.

2. (Less desirable) Have a flag to sched/another builtin which
   synchronously waits for the specified sched item/next N sched
   items/sched items within a certain time frame.

sched is great especially when it is an overkill to use something
like atd. Intuitively, I could guess without seeing the source that
perhaps the existing behaviour exists because it is much neater to
add a postcmd hook than to maybe register a sigalarm. Even if this
is the case, I feel these changes will greatly increase the
functionality of the builtin.

Regards,
Ramkumar.

----- End forwarded message -----



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