Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Can periodic hook stop rescheduling?
- X-seq: zsh-users 21888
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Can periodic hook stop rescheduling?
- Date: Tue, 13 Sep 2016 14:20:03 +0100
- Cms-type: 201P
- In-reply-to: <CAKc7PVDkrKD_2VyvO_2JigwfvU1m=3QwO4Vac=HgHZNbOOU7pA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CGME20160913085130eucas1p19723ac09c11d596542360173e4a4b308@eucas1p1.samsung.com> <CAKc7PVDkrKD_2VyvO_2JigwfvU1m=3QwO4Vac=HgHZNbOOU7pA@mail.gmail.com>
On Tue, 13 Sep 2016 10:49:35 +0200
Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
> 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.
The function that's being called is certainly not immune from getting
^C, and that can certainly stop "sched +2" in its tracks just like any
other command. The only general fix for this would be blocking SIGINT
sufficiently early that ^C doesn't hit this and restoring it later ---
but given sched +2 is the first line of the script anyway that doesn't
look promising.
You might have better results with
{
...
} always {
sched +2 ...
}
but it's still subject to the same problem if the ^C happens at the
wrong point.
This may need some lateral thinking.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author