Update the string that clears the console. (#2071)

* Update the string that clears the console.

#1914
I've tested it with Windows 10 and 7, node versions from ~5.0.0 up to 7.7.0.
Didn't managed to test it on 8 but it should be fine.

* Update windows string

Add windows specific string for clearing the console.
This commit is contained in:
Daniel Verejan
2018-01-09 15:46:29 +02:00
committed by Dan Abramov
parent e3e8cdd699
commit d3a1765470

View File

@@ -8,9 +8,7 @@
'use strict';
function clearConsole() {
process.stdout.write(
process.platform === 'win32' ? '\x1Bc' : '\x1B[2J\x1B[3J\x1B[H'
);
process.stdout.write(process.platform === 'win32' ? '\x1B[2J\x1B[0f' : '\x1B[2J\x1B[3J\x1B[H');
}
module.exports = clearConsole;