From fa695facf5f87010b41ee1ea5a2fd9c1c023ad3d 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 9be47ed114ae2b..2fb689bd7d5abe 100644 --- a/lib/internal/main/watch_mode.js +++ b/lib/internal/main/watch_mode.js @@ -113,7 +113,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`); } }; }