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

Re: precmd: write error: interrupted



On 04/25/2013 08:16 PM, Bart Schaefer 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.

I actually tried to set SA_RESTART only when installing the handler for SIGWINCH when debugging [1]. It works in this case, but I'm not entirely sure it is side-effect free (is doing an ioctl on the tty safe while mid-write?).

What other syscalls would be interrupted by SIGWINCH that shouldn't be restarted? Right now I cannot think of anything that SIGWINCH should interrupt.

You can actually reproduce the bug easily by doing:

while print 'x'; do; done

and resizing the terminal, or by sending SIGWINCH to zsh directly.

[1] interestingly enough, why "interact" is tested for the Sunos4 case?



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