1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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

View file

@ -255,7 +255,11 @@ func (container *Container) Attach(stdin io.ReadCloser, stdinCloser io.Closer, s
if container.Config.StdinOnce && !container.Config.Tty { if container.Config.StdinOnce && !container.Config.Tty {
defer cStdin.Close() defer cStdin.Close()
} }
_, err := CopyEscapable(cStdin, stdin) if container.Config.Tty {
_, err = CopyEscapable(cStdin, stdin)
} else {
_, err = io.Copy(cStdin, stdin)
}
if err != nil { if err != nil {
Debugf("[error] attach stdin: %s\n", err) Debugf("[error] attach stdin: %s\n", err)
} }