summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-04-18 18:52:55 +0200
committerGitHub <noreply@github.com>2018-04-18 18:52:55 +0200
commit7634bd77c59f897bd185e851ad3a429731c8234f (patch)
treeb2bc825c6af0f1018c82bf764f5fee08ce2fb7e3
parent599f33d0b136507c2b00a7f761f401a07ef2ab27 (diff)
parent38726c5906a2add6511e211634d9966097a8a798 (diff)
Merge pull request #1412 from matthiasbeyer/libimagrt/stdin-is-available
Make stdin always available
-rw-r--r--lib/core/libimagrt/src/runtime.rs16
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/core/libimagrt/src/runtime.rs b/lib/core/libimagrt/src/runtime.rs
index 40ffac22..c35af77c 100644
--- a/lib/core/libimagrt/src/runtime.rs
+++ b/lib/core/libimagrt/src/runtime.rs
@@ -52,8 +52,6 @@ pub struct Runtime<'a> {
configuration: Option<Value>,
cli_matches: ArgMatches<'a>,
store: Store,
- stdin_is_tty: bool,
- stdout_is_tty: bool,
}
impl<'a> Runtime<'a> {
@@ -144,8 +142,6 @@ impl<'a> Runtime<'a> {
configuration: config,
rtp: rtp,
store: store,
- stdout_is_tty: ::atty::is(::atty::Stream::Stdout),
- stdin_is_tty: ::atty::is(::atty::Stream::Stdin),
}
})
.chain_err(|| RuntimeErrorKind::Instantiate)
@@ -445,11 +441,7 @@ impl<'a> Runtime<'a> {
}
pub fn stdout(&self) -> OutputProxy {
- if self.stdout_is_tty {
- OutputProxy::Out(::std::io::stdout())
- } else {
- OutputProxy::Err(::std::io::stderr())
- }
+ OutputProxy::Out(::std::io::stdout())
}
pub fn stderr(&self) -> OutputProxy {
@@ -457,11 +449,7 @@ impl<'a> Runtime<'a> {
}
pub fn stdin(&self) -> Option<Stdin> {
- if self.stdin_is_tty {
- Some(::std::io::stdin())
- } else {
- None
- }
+ Some(::std::io::stdin())
}
/// Helper for handling subcommands which are not available.