watch: preserve output when gracefully restarted

PR-URL: https://github.com/nodejs/node/pull/54323
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
This commit is contained in:
Théo LUDWIG 2024-09-30 23:02:58 +02:00 committed by GitHub
parent 28ffa4b751
commit 89a2f565b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -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`);
}
};
}