File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,15 @@ x.scrollUp = ESC + 'S';
78
78
x . scrollDown = ESC + 'T' ;
79
79
80
80
x . clearScreen = '\u001Bc' ;
81
+
82
+ x . clearTerminal = process . platform === 'win32' ?
83
+ `${ x . eraseScreen } ${ ESC } 0f` :
84
+ // 1. Erases the screen (Only done in case `2` is not supported)
85
+ // 2. Erases the whole screen including scrollback buffer
86
+ // 3. Moves cursor to the top-left position
87
+ // More info: https://www.real-world-systems.com/docs/ANSIcode.html
88
+ `${ x . eraseScreen } ${ ESC } 3J${ ESC } H` ;
89
+
81
90
x . beep = BEL ;
82
91
83
92
x . link = ( text , url ) => {
Original file line number Diff line number Diff line change @@ -117,7 +117,11 @@ Scroll display down one line.
117
117
118
118
### clearScreen
119
119
120
- Clear the terminal screen.
120
+ Clear the terminal screen. (Viewport)
121
+
122
+ ### clearTerminal
123
+
124
+ Clear the whole terminal, including scrollback buffer. (Not just the visible part of it)
121
125
122
126
### beep
123
127
You can’t perform that action at this time.
0 commit comments