From 6de8c6390789921808f53b75ecf4c641a3ce9b1b Mon Sep 17 00:00:00 2001 From: ArthurSonzogni Date: Tue, 24 Mar 2020 01:26:06 +0100 Subject: [PATCH] Readd 'resize' handling. It was mistakenly removed. --- src/ftxui/component/screen_interactive.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ftxui/component/screen_interactive.cpp b/src/ftxui/component/screen_interactive.cpp index 3eea128..b62e718 100644 --- a/src/ftxui/component/screen_interactive.cpp +++ b/src/ftxui/component/screen_interactive.cpp @@ -126,9 +126,6 @@ void ScreenInteractive::Loop(Component* component) { SetConsoleMode(stdin_handle, in_mode); SetConsoleMode(stdout_handle, out_mode); #else - // Handle resize. - install_signal_handler(SIGWINCH, OnResize); - struct termios terminal; tcgetattr(STDIN_FILENO, &terminal); on_exit_functions.push([=] { tcsetattr(STDIN_FILENO, TCSANOW, &terminal); }); @@ -136,6 +133,10 @@ void ScreenInteractive::Loop(Component* component) { terminal.c_lflag &= ~ICANON; // Non canonique terminal. terminal.c_lflag &= ~ECHO; // Do not print after a key press. tcsetattr(STDIN_FILENO, TCSANOW, &terminal); + + // Handle resize. + on_resize = [&] { PostEvent(Event::Special({0})); }; + install_signal_handler(SIGWINCH, OnResize); #endif // Hide the cursor and show it at exit.