mirror of https://github.com/docker/docs.git
				
				
				
			Windows: Restore console mode on set mode failure
SetConsoleMode() on input handles appears to remember invalid bits that were set, causing problems for other programs (such as xcopy.exe) trying to set the console mode after docker.exe has exited. Always restore the input console mode on set failure. Signed-off-by: John Starks <jostarks@microsoft.com> (cherry picked from commit 83c186fdd4332b8a08db715e8cb5dd1e80a56567) Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
		
							parent
							
								
									4cd455a8d9
								
							
						
					
					
						commit
						43193233f8
					
				|  | @ -44,9 +44,11 @@ func StdStreams() (stdIn io.ReadCloser, stdOut, stdErr io.Writer) { | |||
| 		if err = winterm.SetConsoleMode(fd, mode|enableVirtualTerminalInput); err != nil { | ||||
| 			emulateStdin = true | ||||
| 		} else { | ||||
| 			winterm.SetConsoleMode(fd, mode) | ||||
| 			vtInputSupported = true | ||||
| 		} | ||||
| 		// Unconditionally set the console mode back even on failure because SetConsoleMode
 | ||||
| 		// remembers invalid bits on input handles.
 | ||||
| 		winterm.SetConsoleMode(fd, mode) | ||||
| 	} | ||||
| 
 | ||||
| 	fd = os.Stdout.Fd() | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue