From 7b4d7717b1d14dbaf251c343ba47b242d9e72eb6 Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Thu, 28 Apr 2022 11:15:37 +0200 Subject: [PATCH] Always set the console size This check doesn't really make sense because the client doesn't know on what OS the daemon is really running. The daemon uses the console size on creation when available (on windows). Signed-off-by: Djordje Lukic --- cli/command/container/run.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/cli/command/container/run.go b/cli/command/container/run.go index 480743611b..698e2a8c38 100644 --- a/cli/command/container/run.go +++ b/cli/command/container/run.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "io" - "runtime" "strings" "syscall" @@ -119,12 +118,10 @@ func runContainer(dockerCli command.Cli, opts *runOptions, copts *containerOptio config.StdinOnce = false } - // Telling the Windows daemon the initial size of the tty during start makes - // a far better user experience rather than relying on subsequent resizes - // to cause things to catch up. - if runtime.GOOS == "windows" { - hostConfig.ConsoleSize[0], hostConfig.ConsoleSize[1] = dockerCli.Out().GetTtySize() - } + // 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()