(ctx context.Context, dockerCli command.Cli, containerID string)
| 175 | } |
| 176 | |
| 177 | func 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 | } |
no test coverage detected
searching dependent graphs…