diff --git a/CHANGELOG.md b/CHANGELOG.md index 85eada3..b75782c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Status: Available for use ### Added ### Fixed +- Don't add "-i" to docker commands when stdin is not a tty. This allows commands `floki run -- ` to be run from inside other scripts even if stdout looks like a tty. ## [1.0.0] - 2022-09-12 diff --git a/src/command.rs b/src/command.rs index 37f0e62..e160f2c 100644 --- a/src/command.rs +++ b/src/command.rs @@ -178,7 +178,7 @@ impl DockerCommandBuilder { fn base_args(&self) -> Vec<&OsStr> { let mut base_args: Vec<&OsStr> = vec!["run".as_ref(), "--rm".as_ref(), "-t".as_ref()]; - if atty::is(atty::Stream::Stdout) { + if atty::is(atty::Stream::Stdout) && atty::is(atty::Stream::Stdin) { base_args.push("-i".as_ref()); } base_args