Expecting to suspect GUI and be able to then "bg" or "fg" it.
8.2.4068
Linux, Gnome, Gnome terminal, starting a GUI vim.
This worked fine before TSTP handling done recently with https://github.com/vim/vim/commit/ab16ad33ba10dd12ff6660fa57b88f1a30ddd8ba The pattern of suspending GUI vim is very useful when opening vim from a Linux terminal. Making it always fork is inconvenient in many other situations where waiting for editing to finish is expected. I can sort of understand the desire to handle TSTP in terminal mode, but in GUI suspending is working perfectly fine. This patch works for me: --- os_unix.c.orig 2022-01-19 18:59:39.050691542 -0800 +++ os_unix.c 2022-01-19 19:32:58.413457141 -0800 @@ -1377,7 +1377,12 @@ #ifdef SIGTSTP // See mch_init() for the conditions under which we ignore SIGTSTP. - signal(SIGTSTP, ignore_sigtstp ? SIG_IGN : (RETSIGTYPE (*)())sig_tstp); + // + // In 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 : (gui.in_use || gui.starting ? SIG_DFL : (RETSIGTYPE (*)())sig_tstp)); #endif #if defined(SIGCONT) signal(SIGCONT, sigcont_handler);
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
This patch works for me:
I can confirm that your patch fixes the issue:
--- vim82/src/os_unix.c 2022-01-19 18:59:39.050691542 -0800 +++ vim82p/src/os_unix.c 2022-01-19 20:04:11.515327287 -0800 @@ -1377,8 +1377,17 @@
#ifdef SIGTSTP
// See mch_init() for the conditions under which we ignore SIGTSTP.
+ // + // In 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.
+#if defined(FEAT_GUI)
+ signal(SIGTSTP, ignore_sigtstp ? SIG_IGN : (gui.in_use || gui.starting ? SIG_DFL : (RETSIGTYPE (*)())sig_tstp));
+#else signal(SIGTSTP, ignore_sigtstp ? SIG_IGN : (RETSIGTYPE (*)())sig_tstp); #endif +#endif #if defined(SIGCONT) signal(SIGCONT, sigcont_handler); #endif
Thank you for your contribution.
I ran all the tests and most of them still passed:
-------------------------------
Executed: 4790 Tests
Skipped: 63 Tests
Failed: 0 Tests
However, among the ones which were skipped, a few contain the word "GUI". I don't know how to make Vim run the tests for the GUI.
@dbivolaru What is your opinion on the patch?
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
Run "gvim" or "vim -g" - new window with GUI opens
BTW, you forgot to pass the -f or --nofork argument to the vim command:
$ vim -g --nofork
^------^
Without, Vim forks a new process, and we cannot reproduce the issue.
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()