From faf7d7e5602e542bc51f2cb3e8ec4b0410610a2e Mon Sep 17 00:00:00 2001 From: dangooddd Date: Wed, 13 Nov 2024 10:38:40 +0300 Subject: [PATCH] Add more comments (clear on resize) --- src/ftxui/component/screen_interactive.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ftxui/component/screen_interactive.cpp b/src/ftxui/component/screen_interactive.cpp index bba13bb..19754bf 100644 --- a/src/ftxui/component/screen_interactive.cpp +++ b/src/ftxui/component/screen_interactive.cpp @@ -858,11 +858,13 @@ void ScreenInteractive::Draw(Component component) { ResetCursorPosition(); std::cout << ResetPosition(/*clear=*/resized); - // clear terminal output if non-fullscreen interactive screen dimx decreases + // clear terminal output if screen dimx decreases + // only on primary screen + // only on POSIX systems (linux/macos) #if !defined(_WIN32) if ((dimx < dimx_) && validated_ && !use_alternative_screen_) { - std::cout << "\033[J"; - std::cout << "\033[H"; + std::cout << "\033[J"; // clear + std::cout << "\033[H"; // move cursor to home position } #endif