mirror of
				https://github.com/ArthurSonzogni/FTXUI.git
				synced 2025-10-31 18:48:11 +08:00 
			
		
		
		
	Flush before applying a new configuration. (#848)
This avoids an ordering problem with whatever the user printed and interacting with termios/WinAPI. Bug:https://github.com/ArthurSonzogni/FTXUI/issues/846
This commit is contained in:
		 Arthur Sonzogni
					Arthur Sonzogni
				
			
				
					committed by
					
						 ArthurSonzogni
						ArthurSonzogni
					
				
			
			
				
	
			
			
			 ArthurSonzogni
						ArthurSonzogni
					
				
			
						parent
						
							a006bcafe1
						
					
				
				
					commit
					03e6685df5
				
			| @@ -568,8 +568,16 @@ ScreenInteractive* ScreenInteractive::Active() { | ||||
|  | ||||
| // private | ||||
| void ScreenInteractive::Install() { | ||||
|  | ||||
|   frame_valid_ = false; | ||||
|  | ||||
|   // Flush the buffer for stdout to ensure whatever the user has printed before | ||||
|   // is fully applied before we start modifying the terminal configuration. This | ||||
|   // is important, because we are using two different channels (stdout vs | ||||
|   // termios/WinAPI) to communicate with the terminal emulator below. See | ||||
|   // https://github.com/ArthurSonzogni/FTXUI/issues/846 | ||||
|   Flush(); | ||||
|  | ||||
|   // After uninstalling the new configuration, flush it to the terminal to | ||||
|   // ensure it is fully applied: | ||||
|   on_exit_functions.push([] { Flush(); }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user