From d164bd090c14a2773269f7b2b8e665ae86d2cc70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20LUDWIG?= Date: Mon, 30 Sep 2024 23:02:58 +0200 Subject: [PATCH] watch: preserve output when gracefully restarted PR-URL: https://github.com/nodejs/node/pull/54323 Reviewed-By: James M Snell Reviewed-By: Moshe Atlow --- lib/internal/main/watch_mode.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/internal/main/watch_mode.js b/lib/internal/main/watch_mode.js index d70908e6e3cd9b..fb07f8a642db3d 100644 --- a/lib/internal/main/watch_mode.js +++ b/lib/internal/main/watch_mode.js @@ -109,7 +109,10 @@ function reportGracefulTermination() { return () => { clearTimeout(graceTimer); if (reported) { - process.stdout.write(`${clear}${green}Gracefully restarted ${kCommandStr}${white}\n`); + if (!kPreserveOutput) { + process.stdout.write(clear); + } + process.stdout.write(`${green}Gracefully restarted ${kCommandStr}${white}\n`); } }; }