Skip to content

Commit fc582da

Browse files
gaearonalexdriaguine
authored andcommitted
Use a better clear console sequence (facebook#1211)
1 parent 837e6b4 commit fc582da

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packages/react-dev-utils/clearConsole.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*/
99

10-
var isFirstClear = true;
1110
function clearConsole() {
12-
// On first run, clear completely so it doesn't show half screen on Windows.
13-
// On next runs, use a different sequence that properly scrolls back.
14-
process.stdout.write(isFirstClear ? '\x1bc' : '\x1b[2J\x1b[0f');
15-
isFirstClear = false;
11+
process.stdout.write(process.platform === 'win32' ? '\x1Bc' : '\x1B[2J\x1B[3J\x1B[H');
1612
}
1713

1814
module.exports = clearConsole;

0 commit comments

Comments
 (0)