Skip to content
Permalink
Browse files

Fix logs with tty

  • Loading branch information
vieux committed Nov 1, 2013
1 parent e3c4984 commit 72bb021c799c54144165856330bdfa30f5825010
Showing with 11 additions and 1 deletion.
  1. +11 −1 commands.go
@@ -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

0 comments on commit 72bb021

Please sign in to comment.
You can’t perform that action at this time.