From c30a954dfc5264ae8583824abd46753e9b6bd204 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 30 Jan 2018 10:46:34 +1100 Subject: [PATCH] ncurses: change handling of suspend to improve terminal state reset the mouse state so that the terminal can take back control of the mouse while Kakoune is suspended, and does not emit focus events anymore. Fixes #1816 --- src/ncurses_ui.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index 00fe269f4..be8cbd1b9 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -270,7 +270,6 @@ NCursesUI::NCursesUI() enable_mouse(true); set_signal_handler(SIGWINCH, on_term_resize); - set_signal_handler(SIGCONT, on_term_resize); check_resize(true); @@ -592,7 +591,13 @@ Optional NCursesUI::get_next_key() return {Key::Backspace}; if (c == control('z')) { - raise(SIGTSTP); + bool mouse_enabled = m_mouse_enabled; + enable_mouse(false); + + raise(SIGTSTP); // We suspend at this line + + check_resize(true); + enable_mouse(mouse_enabled); return {}; } return ctrl(Codepoint(c) - 1 + 'a');