diff --git a/src/nvim/os/os_win_console.c b/src/nvim/os/os_win_console.c index 953d291290..99fd50a040 100644 --- a/src/nvim/os/os_win_console.c +++ b/src/nvim/os/os_win_console.c @@ -29,6 +29,11 @@ int os_open_conin_fd(void) return conin_fd; } +void os_clear_hwnd(void) +{ + hWnd = NULL; +} + void os_replace_stdin_to_conin(void) { close(STDIN_FILENO); diff --git a/src/nvim/os/signal.c b/src/nvim/os/signal.c index 11f99d0a0f..a7c57fff7c 100644 --- a/src/nvim/os/signal.c +++ b/src/nvim/os/signal.c @@ -22,6 +22,11 @@ #endif static SignalWatcher spipe, shup, squit, sterm, susr1, swinch; + +#ifdef MSWIN +# include "nvim/os/os_win_console.h" +#endif + #ifdef SIGPWR static SignalWatcher spwr; #endif @@ -195,12 +200,15 @@ static void on_signal(SignalWatcher *handle, int signum, void *data) case SIGPIPE: // Ignore break; +#endif + case SIGHUP: +#ifdef MSWIN + os_clear_hwnd(); #endif case SIGTERM: #ifdef SIGQUIT case SIGQUIT: #endif - case SIGHUP: if (!rejecting_deadly) { deadly_signal(signum); }