1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

removed RAW mode on server

This commit is contained in:
Victor Vieux 2013-05-07 23:15:42 +02:00
parent a5b765a769
commit 4d30a32c68

View file

@ -530,16 +530,6 @@ func (srv *Server) ContainerAttach(name, logs, stream, stdin, stdout, stderr str
return fmt.Errorf("Impossible to attach to a ghost container") return fmt.Errorf("Impossible to attach to a ghost container")
} }
if container.Config.Tty {
oldState, err := SetRawTerminal()
if err != nil {
if os.Getenv("DEBUG") != "" {
log.Printf("Can't set the terminal in raw mode: %s", err)
}
} else {
defer RestoreTerminal(oldState)
}
}
var ( var (
cStdin io.ReadCloser cStdin io.ReadCloser
cStdout, cStderr io.Writer cStdout, cStderr io.Writer
@ -564,6 +554,12 @@ func (srv *Server) ContainerAttach(name, logs, stream, stdin, stdout, stderr str
} }
<-container.Attach(cStdin, cStdinCloser, cStdout, cStderr) <-container.Attach(cStdin, cStdinCloser, cStdout, cStderr)
// If we are in stdinonce mode, wait for the process to end
// otherwise, simply return
if container.Config.StdinOnce && !container.Config.Tty {
container.Wait()
}
} }
} else { } else {
return fmt.Errorf("No such container: %s", name) return fmt.Errorf("No such container: %s", name)