diff --git a/api/client/utils.go b/api/client/utils.go index 3f8b91c369..cf11fefe5b 100644 --- a/api/client/utils.go +++ b/api/client/utils.go @@ -283,16 +283,16 @@ func (cli *DockerCli) monitorTtySize(id string, isExec bool) error { if runtime.GOOS == "windows" { go func() { - prevW, prevH := cli.getTtySize() + prevH, prevW := cli.getTtySize() for { time.Sleep(time.Millisecond * 250) - w, h := cli.getTtySize() + h, w := cli.getTtySize() if prevW != w || prevH != h { cli.resizeTty(id, isExec) } - prevW = w prevH = h + prevW = w } }() } else { diff --git a/pkg/term/term_windows.go b/pkg/term/term_windows.go index f43721c6a0..5b637928fa 100644 --- a/pkg/term/term_windows.go +++ b/pkg/term/term_windows.go @@ -48,8 +48,8 @@ func GetWinsize(fd uintptr) (*Winsize, error) { // TODO(azlinux): Set the pixel width / height of the console (currently unused by any caller) return &Winsize{ - Width: uint16(info.Window.Bottom - info.Window.Top + 1), - Height: uint16(info.Window.Right - info.Window.Left + 1), + Width: uint16(info.Window.Right - info.Window.Left + 1), + Height: uint16(info.Window.Bottom - info.Window.Top + 1), x: 0, y: 0}, nil }