diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-11-07 15:24:30 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-11-10 01:37:11 -0800 |
| commit | b652bbc6700e36c9ad80105c89d7fc2e3afec111 (patch) | |
| tree | d204a6217cfb8dbc41fdc44346a779ee60665924 /src/libstd/rt/io | |
| parent | df4c0b8e4349d50f317553de5a47d0cd56cdc227 (diff) | |
Fall back from uv tty instances more aggressively
It appears that uv's support for interacting with a stdio stream as a tty when it's actually a pipe is pretty problematic. To get around this, promote a check to see if the stream is a tty to the top of the tty constructor, and bail out quickly if it's not identified as a tty. Closes #10237
Diffstat (limited to 'src/libstd/rt/io')
| -rw-r--r-- | src/libstd/rt/io/stdio.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libstd/rt/io/stdio.rs b/src/libstd/rt/io/stdio.rs index d33821a34b1..674b34639bc 100644 --- a/src/libstd/rt/io/stdio.rs +++ b/src/libstd/rt/io/stdio.rs @@ -277,12 +277,10 @@ impl StdWriter { } } - /// Returns whether this tream is attached to a TTY instance or not. - /// - /// This is similar to libc's isatty() function + /// Returns whether this stream is attached to a TTY instance or not. pub fn isatty(&self) -> bool { match self.inner { - TTY(ref tty) => tty.isatty(), + TTY(*) => true, File(*) => false, } } |
