mirror of
				https://github.com/ArthurSonzogni/FTXUI.git
				synced 2025-10-31 10:38:09 +08:00 
			
		
		
		
	Clear terminal output of interactive screen on resize if alternate screen not in use (#952)
This commit is contained in:
		 Dmitry Nefedov
					Dmitry Nefedov
				
			
				
					committed by
					
						 ArthurSonzogni
						ArthurSonzogni
					
				
			
			
				
	
			
			
			 ArthurSonzogni
						ArthurSonzogni
					
				
			
						parent
						
							aae4e55e43
						
					
				
				
					commit
					a015d8b2d8
				
			| @@ -858,6 +858,13 @@ void ScreenInteractive::Draw(Component component) { | ||||
|   ResetCursorPosition(); | ||||
|   std::cout << ResetPosition(/*clear=*/resized); | ||||
|  | ||||
|   // If the terminal width decrease, the terminal emulator will start wrapping | ||||
|   // lines and make the display dirty. We should clear it completely. | ||||
|   if ((dimx < dimx_) && !use_alternative_screen_) { | ||||
|     std::cout << "\033[J";  // clear terminal output | ||||
|     std::cout << "\033[H";  // move cursor to home position | ||||
|   } | ||||
|  | ||||
|   // Resize the screen if needed. | ||||
|   if (resized) { | ||||
|     dimx_ = dimx; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user