Skip to content

Commit

Permalink
Tweak scroll sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Sep 18, 2016
1 parent 2dd105d commit 801c200
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ function formatMessage(message) {
.replace('./~/css-loader!./~/postcss-loader!', '');
}

var isFirstClear = true;
function clearConsole() {
// This seems to work best on Windows and other systems.
// The intention is to clear the output so you can focus on most recent build.
process.stdout.write('\x1bc');
// On first run, clear completely so it doesn't show half screen on Windows.
// On next runs, use a different sequence that properly scrolls back.
process.stdout.write(isFirstClear ? '\x1bc' : '\x1b[2J\x1b[0f');
isFirstClear = false;
}

function setupCompiler(port, protocol) {
Expand Down

0 comments on commit 801c200

Please sign in to comment.