Skip to content

Commit 9d66d29

Browse files
committed
Don't add -i to docker command when stdin is not a TTY
Signed-off-by: olipratt <olipratt@users.noreply.github.com>
1 parent ddbad3d commit 9d66d29

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Status: Available for use
1616
### Added
1717

1818
### Fixed
19+
- Don't add "-i" to docker commands when stdin is not a tty. This allows commands `floki run -- <command>` to be run from inside other scripts even if stdout looks like a tty.
1920

2021
## [1.0.0] - 2022-09-12
2122

src/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ impl DockerCommandBuilder {
178178

179179
fn base_args(&self) -> Vec<&OsStr> {
180180
let mut base_args: Vec<&OsStr> = vec!["run".as_ref(), "--rm".as_ref(), "-t".as_ref()];
181-
if atty::is(atty::Stream::Stdout) {
181+
if atty::is(atty::Stream::Stdout) && atty::is(atty::Stream::Stdin) {
182182
base_args.push("-i".as_ref());
183183
}
184184
base_args

0 commit comments

Comments
 (0)