MCPcopy Create free account
hub / github.com/docker/cli / restoreTerminal

Function restoreTerminal

cli/command/container/hijack.go:211–230  ·  view source on GitHub ↗
(streams command.Streams, in io.Closer)

Source from the content-addressed store, hash-verified

209}
210
211func 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}

Callers 1

setupInputMethod · 0.70

Calls 4

InMethod · 0.65
OutMethod · 0.65
RestoreTerminalMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…