From f14f7711e7753a60cab182674e4ea064be5f9159 Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 14 Sep 2016 11:55:07 -0700 Subject: [PATCH] Windows: OCI process struct convergence Signed-off-by: John Howard --- command/container/run.go | 2 +- command/container/tty.go | 2 +- command/out.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/command/container/run.go b/command/container/run.go index d36ab610cf..a167e78f9a 100644 --- a/command/container/run.go +++ b/command/container/run.go @@ -135,7 +135,7 @@ func runRun(dockerCli *command.DockerCli, flags *pflag.FlagSet, opts *runOptions // 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() + hostConfig.ConsoleSize.Height, hostConfig.ConsoleSize.Width = dockerCli.Out().GetTtySize() } ctx, cancelFun := context.WithCancel(context.Background()) diff --git a/command/container/tty.go b/command/container/tty.go index edb11592d3..6af8e2becf 100644 --- a/command/container/tty.go +++ b/command/container/tty.go @@ -16,7 +16,7 @@ import ( ) // resizeTtyTo resizes tty to specific height and width -func resizeTtyTo(ctx context.Context, client client.ContainerAPIClient, id string, height, width int, isExec bool) { +func resizeTtyTo(ctx context.Context, client client.ContainerAPIClient, id string, height, width uint, isExec bool) { if height == 0 && width == 0 { return } diff --git a/command/out.go b/command/out.go index 09375d07d7..85718d7acd 100644 --- a/command/out.go +++ b/command/out.go @@ -48,7 +48,7 @@ func (o *OutStream) RestoreTerminal() { } // GetTtySize returns the height and width in characters of the tty -func (o *OutStream) GetTtySize() (int, int) { +func (o *OutStream) GetTtySize() (uint, uint) { if !o.isTerminal { return 0, 0 } @@ -59,7 +59,7 @@ func (o *OutStream) GetTtySize() (int, int) { return 0, 0 } } - return int(ws.Height), int(ws.Width) + return uint(ws.Height), uint(ws.Width) } // NewOutStream returns a new OutStream object from a Writer