MCPcopy Index your code
hub / github.com/docker/cli / resizeTTY

Function resizeTTY

cli/command/container/attach.go:177–190  ·  view source on GitHub ↗
(ctx context.Context, dockerCli command.Cli, containerID string)

Source from the content-addressed store, hash-verified

175}
176
177func resizeTTY(ctx context.Context, dockerCli command.Cli, containerID string) {
178 height, width := dockerCli.Out().GetTtySize()
179 // To handle the case where a user repeatedly attaches/detaches without resizing their
180 // terminal, the only way to get the shell prompt to display for attaches 2+ is to artificially
181 // resize it, then go back to normal. Without this, every attach after the first will
182 // require the user to manually resize or hit enter.
183 resizeTTYTo(ctx, dockerCli.Client(), containerID, height+1, width+1, false)
184
185 // After the above resizing occurs, the call to MonitorTtySize below will handle resetting back
186 // to the actual size.
187 if err := MonitorTtySize(ctx, dockerCli, containerID, false); err != nil {
188 logrus.Debugf("Error monitoring TTY size: %s", err)
189 }
190}

Callers 1

RunAttachFunction · 0.85

Calls 5

resizeTTYToFunction · 0.85
MonitorTtySizeFunction · 0.85
GetTtySizeMethod · 0.80
OutMethod · 0.65
ClientMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…