From 656b66e51b18ff9f5f2720c3ce9ff9ec2937f05f Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Thu, 24 Oct 2013 11:19:06 -0700 Subject: [PATCH] monitor the tty after starting the container --- commands.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/commands.go b/commands.go index 0d997a9c74..5222dffeb1 100644 --- a/commands.go +++ b/commands.go @@ -1623,11 +1623,6 @@ func (cli *DockerCli) CmdRun(args ...string) error { hijacked := make(chan bool) if config.AttachStdin || config.AttachStdout || config.AttachStderr { - if config.Tty { - if err := cli.monitorTtySize(runResult.ID); err != nil { - utils.Errorf("Error monitoring TTY size: %s\n", err) - } - } v := url.Values{} v.Set("stream", "1") @@ -1671,6 +1666,12 @@ func (cli *DockerCli) CmdRun(args ...string) error { return err } + if (config.AttachStdin || config.AttachStdout || config.AttachStderr) && config.Tty { + if err := cli.monitorTtySize(runResult.ID); err != nil { + utils.Errorf("Error monitoring TTY size: %s\n", err) + } + } + if errCh != nil { if err := <-errCh; err != nil { utils.Debugf("Error hijack: %s", err)