File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,6 @@ class ScreenInteractive : public Screen {
121
121
bool mouse_captured = false ;
122
122
bool previous_frame_resized_ = false ;
123
123
124
- bool validated_ = false ;
125
124
bool frame_valid_ = false ;
126
125
127
126
bool force_handle_ctrl_c_ = true ;
Original file line number Diff line number Diff line change @@ -858,15 +858,12 @@ void ScreenInteractive::Draw(Component component) {
858
858
ResetCursorPosition ();
859
859
std::cout << ResetPosition (/* clear=*/ resized);
860
860
861
- // clear terminal output if screen dimx decreases
862
- // only on primary screen
863
- // only on POSIX systems (linux/macos)
864
- #if !defined(_WIN32)
865
- if ((dimx < dimx_) && validated_ && !use_alternative_screen_) {
866
- std::cout << " \033 [J" ; // clear
861
+ // If the terminal width decrease, the terminal emulator will start wrapping
862
+ // lines and make the display dirty. We should clear it completely.
863
+ if ((dimx < dimx_) && !use_alternative_screen_) {
864
+ std::cout << " \033 [J" ; // clear terminal output
867
865
std::cout << " \033 [H" ; // move cursor to home position
868
866
}
869
- #endif
870
867
871
868
// Resize the screen if needed.
872
869
if (resized) {
@@ -934,7 +931,6 @@ void ScreenInteractive::Draw(Component component) {
934
931
std::cout << ToString () << set_cursor_position;
935
932
Flush ();
936
933
Clear ();
937
- validated_ = true ;
938
934
frame_valid_ = true ;
939
935
}
940
936
You can’t perform that action at this time.
0 commit comments