summaryrefslogtreecommitdiffstats
path: root/curs_lib.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2016-09-22 14:07:18 -0700
committerKevin McCarthy <kevin@8t8.us>2016-09-22 14:07:18 -0700
commitdeba0e1c9c40ec32988e36b20f42ee3065d8d6d1 (patch)
tree3413980724be2309722f7d5f8d5dee05e9ee2595 /curs_lib.c
parent4dd44e18097542786eee9d7360eabce7b1f483bf (diff)
Don't abort the menu editor on sigwinch. (closes #3875)
getch() will return ERR on sigwinch when timeout() is called with a positive value. mutt_getch() will therefore return ch==-2 for both a timeout and a sigwinch in this case. The imap code in km_dokey() exits out of the ImapKeepalive loop for a SigWinch, and was skipping past the check for MENU_EDITOR and tmp.ch==-2. Move this check below the gotkey: label so the ImapKeepalive loop behaves the same as the Timeout code. Thanks to nicop for reporting the problem and for the initial patch!
Diffstat (limited to 'curs_lib.c')
-rw-r--r--curs_lib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/curs_lib.c b/curs_lib.c
index 8b21c43f..b747b50d 100644
--- a/curs_lib.c
+++ b/curs_lib.c
@@ -125,9 +125,10 @@ event_t mutt_getch (void)
return err;
}
- if(ch == ERR)
+ /* either timeout, a sigwinch (if timeout is set), or the terminal
+ * has been lost */
+ if (ch == ERR)
{
- /* either timeout or the terminal has been lost */
if (!isatty (0))
{
endwin ();