Ensure ConsoleSize is not nil
Signed-off-by: Darren Stahl <darst@microsoft.com>
This commit is contained in:
parent
0baecaa7cf
commit
04c6bf42e2
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user