diff options
author | Bart Schaefer <schaefer@zsh.org> | 2013-04-28 17:47:43 -0700 |
---|---|---|
committer | Bart Schaefer <schaefer@zsh.org> | 2013-04-30 00:08:49 -0700 |
commit | d19e18c68d6415214afad37ce6cb47ec038ebe1c (patch) | |
tree | c325d0ca0440246d07b758c25a20d6c5f49356b4 /Src/utils.c | |
parent | cbf6f144a942a3db27025e68357b9fd8ca442ed8 (diff) | |
download | zsh-d19e18c68d6415214afad37ce6cb47ec038ebe1c.tar.gz zsh-d19e18c68d6415214afad37ce6cb47ec038ebe1c.tar.xz zsh-d19e18c68d6415214afad37ce6cb47ec038ebe1c.zip |
31350: block SIGWINCH nearly all the time, except
when about to calculate prompts or do synchronous read, so syscalls are not interrupted by window size changes.
Diffstat (limited to 'Src/utils.c')
-rw-r--r-- | Src/utils.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Src/utils.c b/Src/utils.c index 26e2a5c2c..94ae52284 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -1291,6 +1291,13 @@ preprompt(void) int period = getiparam("PERIOD"); int mailcheck = getiparam("MAILCHECK"); + /* + * Handle any pending window size changes before we compute prompts, + * then block them again to avoid interrupts during prompt display. + */ + winch_unblock(); + winch_block(); + if (isset(PROMPTSP) && isset(PROMPTCR) && !use_exit_printed && shout) { /* The PROMPT_SP heuristic will move the prompt down to a new line * if there was any dangling output on the line (assuming the terminal |