mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
fix(cli): do not clear screen for non-TTY environments in watch mode (#17129)
This commit is contained in:
parent
2afac5bf78
commit
118a35f3bc
2 changed files with 13 additions and 9 deletions
|
@ -119,13 +119,13 @@ where
|
|||
pub struct PrintConfig {
|
||||
/// printing watcher status to terminal.
|
||||
pub job_name: String,
|
||||
/// determine whether to clear the terminal screen
|
||||
/// determine whether to clear the terminal screen; applicable to TTY environments only.
|
||||
pub clear_screen: bool,
|
||||
}
|
||||
|
||||
fn create_print_after_restart_fn(clear_screen: bool) -> impl Fn() {
|
||||
move || {
|
||||
if clear_screen {
|
||||
if clear_screen && atty::is(atty::Stream::Stderr) {
|
||||
eprint!("{}", CLEAR_SCREEN);
|
||||
}
|
||||
info!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue