Skip to content
This repository was archived by the owner on Jan 14, 2022. It is now read-only.

Commit 3fc1322

Browse files
committed
Restore console state before exiting
1 parent a8598ab commit 3fc1322

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/progress.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ function ProgressIndicator (message, options, updateFrequency, stream) {
5959
cursor = ansi(stream);
6060
}
6161

62+
process.on('beforeExit', function () {
63+
self.reset();
64+
});
65+
6266
self.update = function update () {
6367
if (cursor) {
6468
// savePosition & restorePosition do not seem to work in Mac OS X

0 commit comments

Comments
 (0)