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

Re: precmd: write error: interrupted

On Thu, 25 Apr 2013 11:16:46 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> } 1) SIGWINCH should either be masked or allow write to restart.
> This requires some thought about the appropriate layer to handle this.
> bin_print does already do some signal queuing when writing to internal
> data structures (print -z, print -s), but that's deliberately isolated
> to bin_print, whereas all sorts of other things might write to the
> terminal -- including other error messages! -- so patching bin_print is
> not covering all the bases.

Certainly true, but I'm hesitant to do nothing except declare it's
difficult...  Explicit user output via print and error messages via
zsh's own error and warning functions are two cases that cover quite a
lot.  If there's already signal queuing in print, is it up to snuff?  Is
there ever a good reason for allowing a single print to be interrupted
at the point of output --- surely it's always going to do unhelpful

I don't think we'd want to queue interrupts round all builtins, but could
we mark those that produce output but otherwise return immediately with
a flag in the builtin table and do some queueing in the builtin handler?
> On the other hand we probably don't want to build a wrapper around the
> entire stdio library just to differentiate terminal writes.

It certainly doesn't sound feasible to do much at the stdio level.
If we were just talking about write() it might feasible to use a simple
wrapper in key places, but it sounds like it can't be reduced to that.


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