Skip to content

Commit

Permalink
Merge pull request #3572 from rumpl/console-size
Browse files Browse the repository at this point in the history
Always set the console size
  • Loading branch information
thaJeztah authored Apr 28, 2022
2 parents 6c9eb70 + 7b4d771 commit a221771
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 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,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()
Expand Down

0 comments on commit a221771

Please sign in to comment.