diff --git a/cmd/podman/containers/run.go b/cmd/podman/containers/run.go index 967ecd0525..fbee95d354 100644 --- a/cmd/podman/containers/run.go +++ b/cmd/podman/containers/run.go @@ -150,6 +150,11 @@ func run(cmd *cobra.Command, args []string) error { } } + // First set the default streams before they get modified by any flags. + runOpts.OutputStream = os.Stdout + runOpts.InputStream = os.Stdin + runOpts.ErrorStream = os.Stderr + // If -i is not set, clear stdin if !cliVals.Interactive { runOpts.InputStream = nil @@ -157,11 +162,6 @@ func run(cmd *cobra.Command, args []string) error { passthrough := cliVals.LogDriver == define.PassthroughLogging - // First set the default streams before they get modified by any flags. - runOpts.OutputStream = os.Stdout - runOpts.InputStream = os.Stdin - runOpts.ErrorStream = os.Stderr - // If attach is set, clear stdin/stdout/stderr and only attach requested if cmd.Flag("attach").Changed { if passthrough {