diff options
author | Bram Moolenaar <Bram@vim.org> | 2008-02-10 21:25:55 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2008-02-10 21:25:55 +0000 |
commit | ae0f2caeb3a493f18495b95977dbec171af55fcf (patch) | |
tree | 299c3deeb1b20245a328c5d4ee9c2776bca2b944 /src/os_unix.c | |
parent | 6f7743ef824f17e9f0757083020c496d7d1ad77a (diff) | |
download | vim-git-ae0f2caeb3a493f18495b95977dbec171af55fcf.tar.gz |
updated for version 7.1-245v7.1.245
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 2dbf5a5fd..07b1f8b0a 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -195,6 +195,7 @@ static char_u *extra_shell_arg = NULL; static int show_shell_mess = TRUE; #endif static int deadly_signal = 0; /* The signal we caught */ +static int in_mch_delay = FALSE; /* sleeping in mch_delay() */ static int curr_tmode = TMODE_COOK; /* contains current terminal mode */ @@ -538,7 +539,9 @@ mch_delay(msec, ignoreinput) if (ignoreinput) { /* Go to cooked mode without echo, to allow SIGINT interrupting us - * here */ + * here. But we don't want QUIT to kill us (CTRL-\ used in a + * shell may produce SIGQUIT). */ + in_mch_delay = TRUE; old_tmode = curr_tmode; if (curr_tmode == TMODE_RAW) settmode(TMODE_SLEEP); @@ -602,6 +605,7 @@ mch_delay(msec, ignoreinput) #endif settmode(old_tmode); + in_mch_delay = FALSE; } else WaitForChar(msec); @@ -922,6 +926,14 @@ deathtrap SIGDEFARG(sigarg) #endif #ifdef SIGHASARG +# ifdef SIGQUIT + /* While in mch_delay() we go to cooked mode to allow a CTRL-C to + * interrupt us. But in cooked mode we may also get SIGQUIT, e.g., when + * pressing CTRL-\, but we don't want Vim to exit then. */ + if (in_mch_delay && sigarg == SIGQUIT) + SIGRETURN; +# endif + /* When SIGHUP, SIGQUIT, etc. are blocked: postpone the effect and return * here. This avoids that a non-reentrant function is interrupted, e.g., * free(). Calling free() again may then cause a crash. */ |