summaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-01-24 12:20:45 +0000
committerBram Moolenaar <Bram@vim.org>2022-01-24 12:20:45 +0000
commit8e4af851fd3eff4b22fca962e5be783742e8f1bb (patch)
treeda82eadf75661f43f9a8d34494f3f43c035a6887 /src/os_unix.c
parent7e765a39b795d5331bf2d4927b41df7b78915af9 (diff)
downloadvim-git-8e4af851fd3eff4b22fca962e5be783742e8f1bb.tar.gz
patch 8.2.4201: when using the GUI CTRL-Z does not stop gvimv8.2.4201
Problem: When using the GUI CTRL-Z does not stop gvim. Solution: When using the GUI set SIGTSTP to SIG_DFL. (Andrew Maltsev, closes #9570)
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 0af6016bb..a0189ea45 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -1378,7 +1378,14 @@ set_signals(void)
#ifdef SIGTSTP
// See mch_init() for the conditions under which we ignore SIGTSTP.
- signal(SIGTSTP, ignore_sigtstp ? SIG_IGN : (RETSIGTYPE (*)())sig_tstp);
+ // In the GUI default TSTP processing is OK.
+ // Checking both gui.in_use and gui.starting because gui.in_use is not set
+ // at this point (set after menus are displayed), but gui.starting is set.
+ signal(SIGTSTP, ignore_sigtstp ? SIG_IGN
+# ifdef FEAT_GUI
+ : gui.in_use || gui.starting ? SIG_DFL
+# endif
+ : (RETSIGTYPE (*)())sig_tstp);
#endif
#if defined(SIGCONT)
signal(SIGCONT, sigcont_handler);