Skip to content

Commit

Permalink
fixes tty size error
Browse files Browse the repository at this point in the history
Signed-off-by: Lifubang <lifubang@acmcoder.com>
  • Loading branch information
lifubang committed Sep 19, 2018
1 parent 3ea56aa commit 2db6708
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cli/command/container/tty.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ func MonitorTtySize(ctx context.Context, cli command.Cli, id string, isExec bool
resizeTtyTo(ctx, cli.Client(), id, height, width, isExec)
}

resizeTty()

if runtime.GOOS == "windows" {
go func() {
prevH, prevW := cli.Out().GetTtySize()
Expand All @@ -70,6 +68,14 @@ func MonitorTtySize(ctx context.Context, cli command.Cli, id string, isExec bool
}
}()
}

go func() {
timeout := 1 * time.Millisecond
select {
case <-time.After(timeout):
resizeTty()
}
}()
return nil
}

Expand Down

0 comments on commit 2db6708

Please sign in to comment.