From 89a2f565b7d3f590ecd64c09473989f36e9b651c 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 9be47ed114a..2fb689bd7d5 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`); } }; }