Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5c551f8

Browse filesBrowse files
authored
Use a better clear console sequence (facebook#1211)
1 parent a60140f commit 5c551f8
Copy full SHA for 5c551f8

File tree

1 file changed

+1
-5
lines changed
Filter options

1 file changed

+1
-5
lines changed

‎packages/react-dev-utils/clearConsole.js

Copy file name to clipboardExpand all lines: packages/react-dev-utils/clearConsole.js
+1-5Lines changed: 1 addition & 5 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.