From 4d30a32c68c199a1e10e68729feb519b74da2961 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Tue, 7 May 2013 23:15:42 +0200 Subject: [PATCH] removed RAW mode on server --- server.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/server.go b/server.go index df81706aa1..a2525a9b90 100644 --- a/server.go +++ b/server.go @@ -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") } - 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 ( cStdin io.ReadCloser 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) + + // 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 { return fmt.Errorf("No such container: %s", name)