Skip to content

Commit

Permalink
resize pty after starting
Browse files Browse the repository at this point in the history
Since ptyMaster is created during container start (startPty), it should
resized after starting, not before.
  • Loading branch information
jpoimboe committed Nov 20, 2013
1 parent cd4c1ac commit 171d681
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ func (cli *DockerCli) CmdStart(args ...string) error {
}

var cErr chan error
var tty bool
if *attach || *openStdin {
if cmd.NArg() > 1 {
return fmt.Errorf("Impossible to start and attach multiple containers at once.")
Expand All @@ -591,17 +592,13 @@ func (cli *DockerCli) CmdStart(args ...string) error {
return err
}

tty = container.Config.Tty

if !container.Config.Tty {
sigc := cli.forwardAllSignals(cmd.Arg(0))
defer utils.StopCatch(sigc)
}

if container.Config.Tty && cli.isTerminal {
if err := cli.monitorTtySize(cmd.Arg(0)); err != nil {
return err
}
}

var in io.ReadCloser

v := url.Values{}
Expand Down Expand Up @@ -639,7 +636,13 @@ func (cli *DockerCli) CmdStart(args ...string) error {
}
return encounteredError
}

if *openStdin || *attach {
if tty && cli.isTerminal {
if err := cli.monitorTtySize(cmd.Arg(0)); err != nil {
utils.Errorf("Error monitoring TTY size: %s\n", err)
}
}
return <-cErr
}
return nil
Expand Down

0 comments on commit 171d681

Please sign in to comment.