summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-04-02 09:20:13 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-04-03 22:23:23 +0000
commit35a10c9ba541807b96b01cc66f79c72606d9ed99 (patch)
tree86bc9000c6b161fd53023f33ae4fa37ee22fcb53 /libpod
parentb1a8d769b84c52ea5ea74263cff6f582b1bdfcf0 (diff)
downloadpodman-35a10c9ba541807b96b01cc66f79c72606d9ed99.tar.gz
podman-35a10c9ba541807b96b01cc66f79c72606d9ed99.tar.bz2
podman-35a10c9ba541807b96b01cc66f79c72606d9ed99.zip
Only allocate tty when -t
In our ezrly development, we always allocated a tty when not -d. Now we should only allocated when the user asks for it. Resolves: #573 Signed-off-by: baude <bbaude@redhat.com> Closes: #574 Approved by: rhatdan
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_attach.go16
1 files changed, 2 insertions, 14 deletions
diff --git a/libpod/container_attach.go b/libpod/container_attach.go
index 3b8f29edb..40d359ddd 100644
--- a/libpod/container_attach.go
+++ b/libpod/container_attach.go
@@ -83,18 +83,6 @@ func (c *Container) attachContainerSocket(resize <-chan remotecommand.TerminalSi
outputStream := os.Stdout
errorStream := os.Stderr
defer inputStream.Close()
-
- // TODO Renable this when tty/terminal discussion is had.
- /*
- tty, err := strconv.ParseBool(c.runningSpec.Annotations["io.kubernetes.cri-o.TTY"])
- if err != nil {
- return errors.Wrapf(err, "unable to parse annotations in %s", c.ID)
- }
- if !tty {
- return errors.Errorf("no tty available for %s", c.ID())
- }
- */
-
if terminal.IsTerminal(int(inputStream.Fd())) {
oldTermState, err := term.SaveState(inputStream.Fd())
if err != nil {
@@ -104,8 +92,8 @@ func (c *Container) attachContainerSocket(resize <-chan remotecommand.TerminalSi
defer term.RestoreTerminal(inputStream.Fd(), oldTermState)
}
- // Put both input and output into raw
- if !noStdIn {
+ // Put both input and output into raw when we have a terminal
+ if !noStdIn && c.config.Spec.Process.Terminal {
term.SetRawTerminal(inputStream.Fd())
}