zsh-workers
 help / color / mirror / code / Atom feed
* [ramk@cse.iitm.ernet.in: Bug#335481: zsh: zsh/sched waits for next return to prompt even with NOTIFY set]
@ 2005-10-24 19:31 Clint Adams
  2005-10-25 22:17 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 2005-10-24 19:31 UTC (permalink / raw)
  To: zsh-workers; +Cc: R.Ramkumar, 335481-forwarded

----- Forwarded message from "R.Ramkumar" <ramk@cse.iitm.ernet.in> -----

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 -----


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ramk@cse.iitm.ernet.in: Bug#335481: zsh: zsh/sched waits for next return to prompt even with NOTIFY set]
  2005-10-24 19:31 [ramk@cse.iitm.ernet.in: Bug#335481: zsh: zsh/sched waits for next return to prompt even with NOTIFY set] Clint Adams
@ 2005-10-25 22:17 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2005-10-25 22:17 UTC (permalink / raw)
  To: Zsh Hackers' List

On Mon, 24 Oct 2005 15:31:37 -0400
Clint Adams <schizo@debian.org> wrote:
> 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.

It's the intended behaviour, not so much because it's useful that way as
because it's the only thing that can be done without an additional
process (or thread, but the shell isn't multithreaded in the usual sense).

> 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.

This would require some use of SIGALRM.  This can be done with a shell
function, for example.  The display features that the notify option uses
are available with the zle command.  That would be a worthwhile addition
to the distribution and probably more flexible than a builtin.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com> Web page still at
http://www.pwstephenson.fsnet.co.uk/


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-10-25 22:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-24 19:31 [ramk@cse.iitm.ernet.in: Bug#335481: zsh: zsh/sched waits for next return to prompt even with NOTIFY set] Clint Adams
2005-10-25 22:17 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).