Commit 5c551f8d authored by Dan Abramov's avatar Dan Abramov Committed by GitHub
Browse files

Use a better clear console sequence (#1211)

parent a60140f8
No related merge requests found
Showing with 1 addition and 5 deletions
+1 -5
......@@ -7,12 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
var isFirstClear = true;
function clearConsole() {
// 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;
process.stdout.write(process.platform === 'win32' ? '\x1Bc' : '\x1B[2J\x1B[3J\x1B[H');
}
module.exports = clearConsole;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment