Add more comments (clear on resize)

This commit is contained in:
dangooddd 2024-11-13 10:38:40 +03:00
parent 766be63c13
commit faf7d7e560

View File

@ -858,11 +858,13 @@ void ScreenInteractive::Draw(Component component) {
ResetCursorPosition(); ResetCursorPosition();
std::cout << ResetPosition(/*clear=*/resized); 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 !defined(_WIN32)
if ((dimx < dimx_) && validated_ && !use_alternative_screen_) { if ((dimx < dimx_) && validated_ && !use_alternative_screen_) {
std::cout << "\033[J"; std::cout << "\033[J"; // clear
std::cout << "\033[H"; std::cout << "\033[H"; // move cursor to home position
} }
#endif #endif