diff options
Diffstat (limited to 'src/delta.rs')
-rw-r--r-- | src/delta.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/delta.rs b/src/delta.rs index 7db15575..3bce32a1 100644 --- a/src/delta.rs +++ b/src/delta.rs @@ -1,7 +1,6 @@ use std::borrow::Cow; use std::collections::HashMap; -use std::io::BufRead; -use std::io::Write; +use std::io::{self, BufRead, IsTerminal, Write}; use bytelines::ByteLines; @@ -260,7 +259,7 @@ impl<'a> StateMachine<'a> { /// If output is going to a tty, emit hyperlinks if requested. // Although raw output should basically be emitted unaltered, we do this. pub fn format_raw_line<'a>(line: &'a str, config: &Config) -> Cow<'a, str> { - if config.hyperlinks && atty::is(atty::Stream::Stdout) { + if config.hyperlinks && io::stdout().is_terminal() { features::hyperlinks::format_commit_line_with_osc8_commit_hyperlink(line, config) } else { Cow::from(line) |