Skip to content

Commit

Permalink
Merge pull request #3619 from vvoland/3554-initial-console-size
Browse files Browse the repository at this point in the history
cli/container: Fill ConsoleSize in create
  • Loading branch information
thaJeztah authored May 18, 2022
2 parents b6aa28b + 6d3bda1 commit 557e6a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 2 additions & 0 deletions cli/command/container/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ func createContainer(ctx context.Context, dockerCli command.Cli, containerConfig
}
}

hostConfig.ConsoleSize[0], hostConfig.ConsoleSize[1] = dockerCli.Out().GetTtySize()

response, err := dockerCli.Client().ContainerCreate(ctx, config, hostConfig, networkingConfig, platform, opts.name)
if err != nil {
// Pull image if it does not exist locally and we have the PullImageMissing option. Default behavior.
Expand Down
6 changes: 0 additions & 6 deletions cli/command/container/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ func runRun(dockerCli command.Cli, flags *pflag.FlagSet, ropts *runOptions, copt
// nolint: gocyclo
func runContainer(dockerCli command.Cli, opts *runOptions, copts *containerOptions, containerConfig *containerConfig) error {
config := containerConfig.Config
hostConfig := containerConfig.HostConfig
stdout, stderr := dockerCli.Out(), dockerCli.Err()
client := dockerCli.Client()

Expand All @@ -138,11 +137,6 @@ func runContainer(dockerCli command.Cli, opts *runOptions, copts *containerOptio
config.StdinOnce = false
}

// Currently ignored on Linux daemons, in the Linux case the TTY size is
// set by calling MonitorTtySize.
// A Windows daemon will create the process with the right TTY size
hostConfig.ConsoleSize[0], hostConfig.ConsoleSize[1] = dockerCli.Out().GetTtySize()

ctx, cancelFun := context.WithCancel(context.Background())
defer cancelFun()

Expand Down

0 comments on commit 557e6a6

Please sign in to comment.