Merge pull request #12127 from ahmetalpbalkan/win-cli/termsize-fix
Swap width/height in GetWinsize and monitorTtySize
This commit is contained in:
commit
9ede3f9fc1
2 changed files with 5 additions and 5 deletions
|
@ -283,16 +283,16 @@ func (cli *DockerCli) monitorTtySize(id string, isExec bool) error {
|
||||||
|
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
go func() {
|
go func() {
|
||||||
prevW, prevH := cli.getTtySize()
|
prevH, prevW := cli.getTtySize()
|
||||||
for {
|
for {
|
||||||
time.Sleep(time.Millisecond * 250)
|
time.Sleep(time.Millisecond * 250)
|
||||||
w, h := cli.getTtySize()
|
h, w := cli.getTtySize()
|
||||||
|
|
||||||
if prevW != w || prevH != h {
|
if prevW != w || prevH != h {
|
||||||
cli.resizeTty(id, isExec)
|
cli.resizeTty(id, isExec)
|
||||||
}
|
}
|
||||||
prevW = w
|
|
||||||
prevH = h
|
prevH = h
|
||||||
|
prevW = w
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -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)
|
// TODO(azlinux): Set the pixel width / height of the console (currently unused by any caller)
|
||||||
return &Winsize{
|
return &Winsize{
|
||||||
Width: uint16(info.Window.Bottom - info.Window.Top + 1),
|
Width: uint16(info.Window.Right - info.Window.Left + 1),
|
||||||
Height: uint16(info.Window.Right - info.Window.Left + 1),
|
Height: uint16(info.Window.Bottom - info.Window.Top + 1),
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0}, nil
|
y: 0}, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue