From e67b3e817615bf045ae64737c1f7177af5b928a5 Mon Sep 17 00:00:00 2001 From: Max Sysoev Date: Thu, 8 Dec 2016 20:28:33 +0300 Subject: [PATCH] Clear scrollback on terminal clear in watch mode (#2230) * Send reset screen symbol instead of clear * Use other symbol for clearing terminal on Windows * Clear remaining screen on linux/os x --- packages/jest-cli/src/jest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jest-cli/src/jest.js b/packages/jest-cli/src/jest.js index 445b60df29bc..c0ec7583ba32 100644 --- a/packages/jest-cli/src/jest.js +++ b/packages/jest-cli/src/jest.js @@ -34,7 +34,7 @@ const sane = require('sane'); const which = require('which'); const TestWatcher = require('./TestWatcher'); -const CLEAR = '\x1B[2J\x1B[H'; +const CLEAR = process.platform === 'win32' ? '\x1Bc' : '\x1B[2J\x1B[3J\x1B[H'; const VERSION = require('../package.json').version; const WATCHER_DEBOUNCE = 200; const WATCHMAN_BIN = 'watchman';