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

Re: precmd: write error: interrupted

On 04/26/2013 05:08 PM, Bart Schaefer wrote:
} What other syscalls would be interrupted by SIGWINCH that shouldn't be
} restarted? Right now I cannot think of anything that SIGWINCH should
} interrupt.

I've been thinking about this, and the problem with using SA_RESTART is

(1) [Minor] Some platforms don't have restartable syscalls, so this won't
work everywhere.  But perhaps the intersection of non-restarable syscalls
and support for SIGWINCH is empty.

(I'm somehow curious of which systems don't support SIGWINCH, must be particularly old).

(2) [Potentially major] A user-defined trap can be installed for the
SIGWINCH signal.  That means arbitrary shell code might execute during
handling of the signal, so all sorts of things might happen mid-write,
not just the default ioctls.

I see, and now I also see your reasoning about queuing SIGWINCH everywhere except when waiting in zleread. At any rate, that's the only point where updating the terminal for the upcoming output makes sense. Updating the column count (for example) while in the middle of a widget expansion for instance won't likely help (or maybe even break some invariant).

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