Skip to content

Commit

Permalink
Always set the console size
Browse files Browse the repository at this point in the history
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 <djordje.lukic@docker.com>
  • Loading branch information
rumpl committed Apr 28, 2022
1 parent 6c9eb70 commit 1410137
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions cli/command/container/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"io"
"runtime"
"strings"
"syscall"

Expand Down Expand Up @@ -119,12 +118,7 @@ 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()
}
hostConfig.ConsoleSize[0], hostConfig.ConsoleSize[1] = dockerCli.Out().GetTtySize()

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

0 comments on commit 1410137

Please sign in to comment.