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

Function resizeTTYTo

cli/command/container/tty.go:27–49  ·  view source on GitHub ↗

resizeTTYTo resizes TTY to specific height and width.

(ctx context.Context, apiClient resizeClient, id string, height, width uint, isExec bool)

Source from the content-addressed store, hash-verified

25
26// resizeTTYTo resizes TTY to specific height and width.
27func resizeTTYTo(ctx context.Context, apiClient resizeClient, id string, height, width uint, isExec bool) error {
28 if height == 0 && width == 0 {
29 return nil
30 }
31
32 var err error
33 if isExec {
34 _, err = apiClient.ExecResize(ctx, id, client.ExecResizeOptions{
35 Height: height,
36 Width: width,
37 })
38 } else {
39 _, err = apiClient.ContainerResize(ctx, id, client.ContainerResizeOptions{
40 Height: height,
41 Width: width,
42 })
43 }
44
45 if err != nil {
46 logrus.Debugf("Error resize: %s\r", err)
47 }
48 return err
49}
50
51// resizeTty is to resize the tty with cli out's tty size
52func resizeTty(ctx context.Context, cli command.Cli, id string, isExec bool) error {

Callers 3

resizeTTYFunction · 0.85
resizeTtyFunction · 0.85
TestInitTtySizeErrorsFunction · 0.85

Calls 1

ExecResizeMethod · 0.80

Tested by 1

TestInitTtySizeErrorsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…