mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 09:56:31 +00:00
fix(events): crash on SIGTSTP (Ctrl-Z) #33258
Problem:
Nvim crashes on receive SIGTSTP (Ctrl-Z) since 4dabeff308
.
Solution:
* Don't exit on SIGTSTP (not a deadly signal).
* Avoid SIGTSTP handler in os/signal.c.
Co-authored-by: 27Onion Nebell <zzy20080201@gmail.com>
This commit is contained in:
@@ -212,10 +212,14 @@ static void on_signal(SignalWatcher *handle, int signum, void *data)
|
||||
// Ignore
|
||||
break;
|
||||
#endif
|
||||
case SIGTERM:
|
||||
#ifdef SIGTSTP
|
||||
case SIGTSTP:
|
||||
if (p_awa) {
|
||||
autowrite_all();
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case SIGTERM:
|
||||
#ifdef SIGQUIT
|
||||
case SIGQUIT:
|
||||
#endif
|
||||
|
@@ -1576,7 +1576,8 @@ void tui_suspend(TUIData *tui)
|
||||
tui_terminal_stop(tui);
|
||||
stream_set_blocking(tui->input.in_fd, true); // normalize stream (#2598)
|
||||
|
||||
kill(0, SIGTSTP);
|
||||
// Avoid os/signal.c SIGTSTP handler. ex_stop calls auto_writeall. #33258
|
||||
kill(0, SIGSTOP);
|
||||
|
||||
tui_terminal_start(tui);
|
||||
tui_terminal_after_startup(tui);
|
||||
|
Reference in New Issue
Block a user