Merge pull request #26579 from Microsoft/jjh/ociprocess

Windows: OCI `process` struct and console size to uint
This commit is contained in:
Sebastiaan van Stijn 2016-09-19 22:52:16 +02:00 committed by GitHub
commit 889980d6e3
3 changed files with 4 additions and 4 deletions

View File

@ -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())

View File

@ -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
}

View File

@ -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