From 40d5ccfb17958f146c1c202165f90a4b4962208f Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sun, 11 Dec 2016 02:04:09 -0800 Subject: [PATCH] Use a better clear console sequence (#1211) --- packages/react-dev-utils/clearConsole.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/react-dev-utils/clearConsole.js b/packages/react-dev-utils/clearConsole.js index e37af65543..cfd1015516 100644 --- a/packages/react-dev-utils/clearConsole.js +++ b/packages/react-dev-utils/clearConsole.js @@ -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;