From 04c6bf42e2bc638816e0615304e995dbefea1ed3 Mon Sep 17 00:00:00 2001 From: Darren Stahl Date: Wed, 30 Aug 2017 16:34:20 -0700 Subject: [PATCH] Ensure ConsoleSize is not nil Signed-off-by: Darren Stahl --- spec_opts_windows.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec_opts_windows.go b/spec_opts_windows.go index 8f0fa6139..33ee74e3f 100644 --- a/spec_opts_windows.go +++ b/spec_opts_windows.go @@ -53,6 +53,9 @@ func WithImageConfig(i Image) SpecOpts { func WithTTY(width, height int) SpecOpts { return func(_ context.Context, _ *Client, _ *containers.Container, s *specs.Spec) error { s.Process.Terminal = true + if s.Process.ConsoleSize == nil { + s.Process.ConsoleSize = &specs.Box{} + } s.Process.ConsoleSize.Width = uint(width) s.Process.ConsoleSize.Height = uint(height) return nil