Skip to content

Commit

Permalink
Add more comments (clear on resize)
Browse files Browse the repository at this point in the history
  • Loading branch information
dangooddd committed Nov 13, 2024
1 parent 766be63 commit faf7d7e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ftxui/component/screen_interactive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit faf7d7e

Please sign in to comment.