diff options
Diffstat (limited to 'cli/src/main.rs')
| -rw-r--r-- | cli/src/main.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/src/main.rs b/cli/src/main.rs index 476a82ee..4e9bd43e 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -9,6 +9,7 @@ use std::io::{self, Write}; use std::path::{Path, PathBuf}; use std::process; +use atty::Stream; use clap::Parser; use codespan_reporting::diagnostic::{Diagnostic, Label}; use codespan_reporting::term::{self, termcolor}; @@ -282,7 +283,9 @@ fn status(command: &CompileSettings, status: Status) -> io::Result<()> { let color = status.color(); let mut w = StandardStream::stderr(ColorChoice::Auto); - write!(w, "{esc}c{esc}[1;1H")?; + if atty::is(Stream::Stderr) { + write!(w, "{esc}c{esc}[1;1H")?; + } w.set_color(&color)?; write!(w, "watching")?; |
