Look for the escape sequence only in tty mode

This commit is contained in:
Guillaume J. Charmes 2013-04-04 12:57:45 -07:00
parent 1f70b1e15d
commit faa8843650
1 changed files with 5 additions and 1 deletions

View File

@ -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)
}