diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-03-24 15:28:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-24 15:28:25 -0700 |
commit | ebb57df0f67c1e92ad246bab74f971390c793b98 (patch) | |
tree | 238247a0fab3bdcc46e5fb03b7becba2e60057fd /cmd | |
parent | 545127c07562bfaa9aa0cf1641b0bd51b37343c9 (diff) | |
parent | 00949d0bd8a08dcb4d619bebddd1dc3ef3b62e73 (diff) | |
download | podman-ebb57df0f67c1e92ad246bab74f971390c793b98.tar.gz podman-ebb57df0f67c1e92ad246bab74f971390c793b98.tar.bz2 podman-ebb57df0f67c1e92ad246bab74f971390c793b98.zip |
Merge pull request #9747 from rhatdan/tty
Check if stdin is a term in --interactive --tty mode
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/containers/run.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/podman/containers/run.go b/cmd/podman/containers/run.go index 83a5d7b8a..db7180ca9 100644 --- a/cmd/podman/containers/run.go +++ b/cmd/podman/containers/run.go @@ -17,6 +17,7 @@ import ( "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/spf13/cobra" + "golang.org/x/crypto/ssh/terminal" ) var ( @@ -106,6 +107,11 @@ func run(cmd *cobra.Command, args []string) error { return err } + // TODO: Breaking change should be made fatal in next major Release + if cliVals.TTY && cliVals.Interactive && !terminal.IsTerminal(int(os.Stdin.Fd())) { + logrus.Warnf("The input device is not a TTY. The --tty and --interactive flags might not work properly") + } + if af := cliVals.Authfile; len(af) > 0 { if _, err := os.Stat(af); err != nil { return err |