Skip to content
This repository was archived by the owner on Jul 27, 2021. It is now read-only.

Commit e4f2079

Browse files
timneutkensgeowarin
authored andcommitted
Use a better console sequence to clear the console (#21)
1 parent 7ce1bcb commit e4f2079

File tree

3 files changed

+319
-319
lines changed

3 files changed

+319
-319
lines changed

_sandbox/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ export default class MyComponent extends React.Component {
66
render() {
77
return <div>Hello</div>
88
}
9-
}
9+
}

src/output.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const colors = require('./utils/colors');
44
const chalk = require('chalk');
5+
const readline = require('readline')
56

67
class Debugger {
78

@@ -57,7 +58,7 @@ class Debugger {
5758

5859
clearConsole () {
5960
if (!this.capturing && this.enabled) {
60-
process.stdout.write('\x1bc');
61+
process.stdout.write(process.platform === 'win32' ? '\x1Bc' : '\x1B[2J\x1B[3J\x1B[H');
6162
}
6263
}
6364

0 commit comments

Comments
 (0)