mirror of
https://github.com/neovim/neovim.git
synced 2025-09-05 19:08:15 +00:00
fix(windows): don't set window icon on SIGHUP #34260
Problem: When using conhost and pressing the 'x' button to close it while nvim is open, nvim hangs up while trying to reset the window icon, causing a big delay before the terminal actually closes. #34171 Solution: Set the window handle to NULL after receiving SIGHUP so that nvim will not try resetting the icon.
This commit is contained in:

committed by
GitHub

parent
981d4ba45e
commit
52991d8728
@@ -29,6 +29,11 @@ int os_open_conin_fd(void)
|
|||||||
return conin_fd;
|
return conin_fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void os_clear_hwnd(void)
|
||||||
|
{
|
||||||
|
hWnd = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void os_replace_stdin_to_conin(void)
|
void os_replace_stdin_to_conin(void)
|
||||||
{
|
{
|
||||||
close(STDIN_FILENO);
|
close(STDIN_FILENO);
|
||||||
|
@@ -23,6 +23,10 @@
|
|||||||
# include "nvim/memline.h"
|
# include "nvim/memline.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MSWIN
|
||||||
|
# include "nvim/os/os_win_console.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
static SignalWatcher spipe, shup, squit, sterm, susr1, swinch, ststp;
|
static SignalWatcher spipe, shup, squit, sterm, susr1, swinch, ststp;
|
||||||
#ifdef SIGPWR
|
#ifdef SIGPWR
|
||||||
static SignalWatcher spwr;
|
static SignalWatcher spwr;
|
||||||
@@ -218,12 +222,15 @@ static void on_signal(SignalWatcher *handle, int signum, void *data)
|
|||||||
autowrite_all();
|
autowrite_all();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
case SIGHUP:
|
||||||
|
#ifdef MSWIN
|
||||||
|
os_clear_hwnd();
|
||||||
#endif
|
#endif
|
||||||
case SIGTERM:
|
case SIGTERM:
|
||||||
#ifdef SIGQUIT
|
#ifdef SIGQUIT
|
||||||
case SIGQUIT:
|
case SIGQUIT:
|
||||||
#endif
|
#endif
|
||||||
case SIGHUP:
|
|
||||||
if (!rejecting_deadly) {
|
if (!rejecting_deadly) {
|
||||||
deadly_signal(signum);
|
deadly_signal(signum);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user