From 7e1e7d14fa257692231bc7e13e796e07607879c2 Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Fri, 5 Apr 2013 19:48:49 -0700 Subject: [PATCH] Make sure to flush buffer when setting raw mode --- commands.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/commands.go b/commands.go index 7e62596570..25889b46f9 100644 --- a/commands.go +++ b/commands.go @@ -803,6 +803,8 @@ func (srv *Server) CmdAttach(stdin io.ReadCloser, stdout rcli.DockerConn, args . if container.Config.Tty { stdout.SetOptionRawTerminal() + // Flush the options to make sure the client sets the raw mode + stdout.Write([]byte{}) } return <-container.Attach(stdin, nil, stdout, stdout) } @@ -888,8 +890,11 @@ func (srv *Server) CmdRun(stdin io.ReadCloser, stdout rcli.DockerConn, args ...s fmt.Fprintln(stdout, "Error: Command not specified") return fmt.Errorf("Command not specified") } + if config.Tty { stdout.SetOptionRawTerminal() + // Flush the options to make sure the client sets the raw mode + stdout.Write([]byte{}) } // Create new container