(streams command.Streams, in io.Closer)
| 209 | } |
| 210 | |
| 211 | func restoreTerminal(streams command.Streams, in io.Closer) error { |
| 212 | streams.In().RestoreTerminal() |
| 213 | streams.Out().RestoreTerminal() |
| 214 | // WARNING: DO NOT REMOVE THE OS CHECKS !!! |
| 215 | // For some reason this Close call blocks on darwin.. |
| 216 | // As the client exits right after, simply discard the close |
| 217 | // until we find a better solution. |
| 218 | // |
| 219 | // This can also cause the client on Windows to get stuck in Win32 CloseHandle() |
| 220 | // in some cases. See https://github.com/docker/docker/issues/28267#issuecomment-288237442 |
| 221 | // Tracked internally at Microsoft by VSO #11352156. In the |
| 222 | // Windows case, you hit this if you are using the native/v2 console, |
| 223 | // not the "legacy" console, and you start the client in a new window. eg |
| 224 | // `start docker run --rm -it microsoft/nanoserver cmd /s /c echo foobar` |
| 225 | // will hang. Remove start, and it won't repro. |
| 226 | if in != nil && runtime.GOOS != "darwin" && runtime.GOOS != "windows" { |
| 227 | return in.Close() |
| 228 | } |
| 229 | return nil |
| 230 | } |
no test coverage detected
searching dependent graphs…