From 118a35f3bc353cae96bcb29bc96c4f60a7bb1936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Og=C3=B3rek?= Date: Mon, 19 Dec 2022 18:59:32 +0100 Subject: fix(cli): do not clear screen for non-TTY environments in watch mode (#17129) --- cli/util/file_watcher.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/util/file_watcher.rs') diff --git a/cli/util/file_watcher.rs b/cli/util/file_watcher.rs index 5158437a0..b85df3bd6 100644 --- a/cli/util/file_watcher.rs +++ b/cli/util/file_watcher.rs @@ -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!( -- cgit v1.2.3