Browse Source

Swap width/height in GetWinsize and monitorTtySize

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
(cherry picked from commit 6e44246fed43341938a41c6db9b115e1e64d332a)
Ahmet Alp Balkan 10 years ago
parent
commit
ceb72fab34
2 changed files with 5 additions and 5 deletions
  1. 3 3
      api/client/utils.go
  2. 2 2
      pkg/term/term_windows.go

+ 3 - 3
api/client/utils.go

@@ -281,16 +281,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 {

+ 2 - 2
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
 }