Browse code

Look for the escape sequence only in tty mode

Guillaume J. Charmes authored on 2013/04/05 04:57:45
Showing 1 changed files
... ...
@@ -255,7 +255,11 @@ func (container *Container) Attach(stdin io.ReadCloser, stdinCloser io.Closer, s
255 255
 				if container.Config.StdinOnce && !container.Config.Tty {
256 256
 					defer cStdin.Close()
257 257
 				}
258
-				_, err := CopyEscapable(cStdin, stdin)
258
+				if container.Config.Tty {
259
+					_, err = CopyEscapable(cStdin, stdin)
260
+				} else {
261
+					_, err = io.Copy(cStdin, stdin)
262
+				}
259 263
 				if err != nil {
260 264
 					Debugf("[error] attach stdin: %s\n", err)
261 265
 				}