diff --git a/src/terminal_ui.cc b/src/terminal_ui.cc index 6b2a5966b..40cca53a9 100644 --- a/src/terminal_ui.cc +++ b/src/terminal_ui.cc @@ -398,6 +398,7 @@ void TerminalUI::suspend() { bool mouse_enabled = m_mouse_enabled; enable_mouse(false); + tcsetattr(STDIN_FILENO, TCSAFLUSH, &m_original_termios); restore_terminal(); auto current = set_signal_handler(SIGTSTP, SIG_DFL); @@ -408,7 +409,6 @@ void TerminalUI::suspend() raise(SIGTSTP); // suspend here - tcsetattr(STDIN_FILENO, TCSAFLUSH, &m_original_termios); set_signal_handler(SIGTSTP, current); sigprocmask(SIG_SETMASK, &old_mask, nullptr);