Skip to content

Commit

Permalink
Fix logs with tty
Browse files Browse the repository at this point in the history
  • Loading branch information
vieux committed Nov 1, 2013
1 parent e3c4984 commit 72bb021
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion commands.go
Expand Up @@ -1340,8 +1340,18 @@ func (cli *DockerCli) CmdLogs(args ...string) error {
return nil
}
name := cmd.Arg(0)
body, _, err := cli.call("GET", "/containers/"+name+"/json", nil)
if err != nil {
return err
}

container := &Container{}
err = json.Unmarshal(body, container)
if err != nil {
return err
}

if err := cli.hijack("POST", "/containers/"+name+"/attach?logs=1&stdout=1&stderr=1", false, nil, cli.out, cli.err, nil); err != nil {
if err := cli.hijack("POST", "/containers/"+name+"/attach?logs=1&stdout=1&stderr=1", container.Config.Tty, nil, cli.out, cli.err, nil); err != nil {
return err
}
return nil
Expand Down

0 comments on commit 72bb021

Please sign in to comment.