From faa88436504e4a4a63ddb4f3736b11e721b760cd Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Thu, 4 Apr 2013 12:57:45 -0700 Subject: [PATCH] Look for the escape sequence only in tty mode --- container.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/container.go b/container.go index 5c4f8aa5f..bc5e0ab87 100644 --- a/container.go +++ b/container.go @@ -255,7 +255,11 @@ func (container *Container) Attach(stdin io.ReadCloser, stdinCloser io.Closer, s if container.Config.StdinOnce && !container.Config.Tty { defer cStdin.Close() } - _, err := CopyEscapable(cStdin, stdin) + if container.Config.Tty { + _, err = CopyEscapable(cStdin, stdin) + } else { + _, err = io.Copy(cStdin, stdin) + } if err != nil { Debugf("[error] attach stdin: %s\n", err) }