@visulima/ansi 1.0.18 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +86 -0
- package/LICENSE.md +76 -74
- package/README.md +335 -2
- package/dist/alternative-screen.cjs +11 -5
- package/dist/alternative-screen.d.cts +74 -4
- package/dist/alternative-screen.d.mts +74 -4
- package/dist/alternative-screen.d.ts +74 -4
- package/dist/alternative-screen.mjs +8 -4
- package/dist/clear.cjs +10 -18
- package/dist/clear.d.cts +77 -7
- package/dist/clear.d.mts +77 -7
- package/dist/clear.d.ts +77 -7
- package/dist/clear.mjs +8 -15
- package/dist/constants.d.cts +20 -0
- package/dist/constants.d.mts +20 -0
- package/dist/constants.d.ts +20 -0
- package/dist/cursor.cjs +19 -2
- package/dist/cursor.d.cts +436 -30
- package/dist/cursor.d.mts +436 -30
- package/dist/cursor.d.ts +436 -30
- package/dist/cursor.mjs +2 -2
- package/dist/erase.cjs +44 -13
- package/dist/erase.d.cts +206 -9
- package/dist/erase.d.mts +206 -9
- package/dist/erase.d.ts +206 -9
- package/dist/erase.mjs +40 -14
- package/dist/helpers.d.cts +14 -0
- package/dist/helpers.d.mts +14 -0
- package/dist/helpers.d.ts +14 -0
- package/dist/hyperlink.cjs +9 -0
- package/dist/hyperlink.d.cts +29 -0
- package/dist/hyperlink.d.mts +27 -0
- package/dist/hyperlink.d.ts +29 -0
- package/dist/hyperlink.mjs +7 -0
- package/dist/image.cjs +12 -5
- package/dist/image.d.cts +69 -58
- package/dist/image.d.mts +69 -58
- package/dist/image.d.ts +69 -58
- package/dist/image.mjs +10 -5
- package/dist/index.cjs +209 -11
- package/dist/index.d.cts +35 -12
- package/dist/index.d.mts +35 -12
- package/dist/index.d.ts +35 -12
- package/dist/index.mjs +20 -7
- package/dist/iterm2/iterm2-properties.d.cts +135 -0
- package/dist/iterm2/iterm2-properties.d.mts +135 -0
- package/dist/iterm2/iterm2-properties.d.ts +135 -0
- package/dist/iterm2/iterm2-sequences.d.cts +96 -0
- package/dist/iterm2/iterm2-sequences.d.mts +96 -0
- package/dist/iterm2/iterm2-sequences.d.ts +96 -0
- package/dist/iterm2.cjs +26 -0
- package/dist/iterm2.d.cts +58 -0
- package/dist/iterm2.d.mts +58 -0
- package/dist/iterm2.d.ts +58 -0
- package/dist/iterm2.mjs +14 -0
- package/dist/mode.cjs +388 -0
- package/dist/mode.d.cts +657 -0
- package/dist/mode.d.mts +657 -0
- package/dist/mode.d.ts +657 -0
- package/dist/mode.mjs +235 -0
- package/dist/mouse.cjs +127 -0
- package/dist/mouse.d.cts +230 -0
- package/dist/mouse.d.mts +230 -0
- package/dist/mouse.d.ts +230 -0
- package/dist/mouse.mjs +108 -0
- package/dist/packem_shared/IT2_AUTO-5vTJQMm6.cjs +15 -0
- package/dist/packem_shared/IT2_AUTO-DnfCUXso.mjs +8 -0
- package/dist/packem_shared/ITerm2File-BGPqNSjB.cjs +137 -0
- package/dist/packem_shared/ITerm2File-DKFkdqdA.mjs +130 -0
- package/dist/packem_shared/{constants-D8u2npjW.cjs → constants-BK26O-46.cjs} +4 -0
- package/dist/packem_shared/constants-CE7WkXh_.mjs +9 -0
- package/dist/packem_shared/cursor-CQKLCu7U.cjs +105 -0
- package/dist/packem_shared/cursor-DhFQcQ9g.mjs +73 -0
- package/dist/passthrough.cjs +38 -0
- package/dist/passthrough.d.cts +77 -0
- package/dist/passthrough.d.mts +77 -0
- package/dist/passthrough.d.ts +77 -0
- package/dist/passthrough.mjs +31 -0
- package/dist/reset.cjs +9 -0
- package/dist/reset.d.cts +26 -0
- package/dist/reset.d.mts +26 -0
- package/dist/reset.d.ts +26 -0
- package/dist/reset.mjs +4 -0
- package/dist/screen.cjs +41 -0
- package/dist/screen.d.cts +234 -0
- package/dist/screen.d.mts +234 -0
- package/dist/screen.d.ts +234 -0
- package/dist/screen.mjs +29 -0
- package/dist/scroll.cjs +17 -3
- package/dist/scroll.d.cts +67 -4
- package/dist/scroll.d.mts +67 -4
- package/dist/scroll.d.ts +67 -4
- package/dist/scroll.mjs +16 -4
- package/dist/status.cjs +147 -0
- package/dist/status.d.cts +501 -0
- package/dist/status.d.mts +501 -0
- package/dist/status.d.ts +501 -0
- package/dist/status.mjs +104 -0
- package/dist/strip.d.cts +23 -1
- package/dist/strip.d.mts +22 -2
- package/dist/strip.d.ts +23 -1
- package/dist/termcap.cjs +33 -0
- package/dist/termcap.d.cts +38 -0
- package/dist/termcap.d.mts +38 -0
- package/dist/termcap.d.ts +38 -0
- package/dist/termcap.mjs +27 -0
- package/dist/title.cjs +31 -0
- package/dist/title.d.cts +185 -0
- package/dist/title.d.mts +185 -0
- package/dist/title.d.ts +185 -0
- package/dist/title.mjs +20 -0
- package/dist/window-ops.cjs +85 -0
- package/dist/window-ops.d.cts +418 -0
- package/dist/window-ops.d.mts +418 -0
- package/dist/window-ops.d.ts +418 -0
- package/dist/window-ops.mjs +63 -0
- package/dist/xterm.cjs +48 -0
- package/dist/xterm.d.cts +94 -0
- package/dist/xterm.d.mts +94 -0
- package/dist/xterm.d.ts +94 -0
- package/dist/xterm.mjs +35 -0
- package/package.json +153 -9
- package/dist/link.cjs +0 -9
- package/dist/link.d.cts +0 -3
- package/dist/link.d.mts +0 -3
- package/dist/link.d.ts +0 -3
- package/dist/link.mjs +0 -7
- package/dist/packem_shared/constants-CqXMfQy0.mjs +0 -7
- package/dist/packem_shared/cursor-2tHgT9r6.cjs +0 -57
- package/dist/packem_shared/cursor-CDCWqbC9.mjs +0 -42
package/dist/erase.d.cts
CHANGED
|
@@ -1,9 +1,206 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Defines the modes for erasing parts of the display using the ED (Erase in Display) sequence.
|
|
3
|
+
* The ED sequence is `CSI Ps J`, where `Ps` is one of these mode values.
|
|
4
|
+
* @see {@link eraseDisplay} for the function that generates ED sequences.
|
|
5
|
+
* @see {@link https://vt100.net/docs/vt510-rm/ED.html} VT510 Erase in Display (ED) documentation.
|
|
6
|
+
* @enum {number}
|
|
7
|
+
*/
|
|
8
|
+
export declare enum EraseDisplayMode {
|
|
9
|
+
/**
|
|
10
|
+
* Clears the entire screen. The cursor position usually does not change, but this can be
|
|
11
|
+
* terminal-dependent. Some terminals might move the cursor to the home position (top-left).
|
|
12
|
+
* This corresponds to `Ps=2` in `CSI Ps J`.
|
|
13
|
+
* Sequence: `CSI 2J`.
|
|
14
|
+
*/
|
|
15
|
+
EntireScreen = 2,
|
|
16
|
+
/**
|
|
17
|
+
* Clears the entire screen and, on supported terminals (like XTerm and derivatives),
|
|
18
|
+
* also deletes all lines saved in the scrollback buffer.
|
|
19
|
+
* This corresponds to `Ps=3` in `CSI Ps J` (an XTerm extension, widely adopted).
|
|
20
|
+
* Sequence: `CSI 3J`.
|
|
21
|
+
* @remarks This mode is particularly useful for a more complete "reset" of the terminal view.
|
|
22
|
+
*/
|
|
23
|
+
EntireScreenAndScrollback = 3,
|
|
24
|
+
/**
|
|
25
|
+
* Clears from the beginning of the screen to the current cursor position (inclusive).
|
|
26
|
+
* This corresponds to `Ps=1` in `CSI Ps J`.
|
|
27
|
+
* Sequence: `CSI 1J`.
|
|
28
|
+
*/
|
|
29
|
+
ToBeginning = 1,
|
|
30
|
+
/**
|
|
31
|
+
* Clears from the current cursor position to the end of the screen (inclusive).
|
|
32
|
+
* If the cursor is at the top-left, this clears the entire screen.
|
|
33
|
+
* This corresponds to `Ps=0` (or `Ps` omitted) in `CSI Ps J`.
|
|
34
|
+
* Sequence: `CSI J` or `CSI 0J`.
|
|
35
|
+
*/
|
|
36
|
+
ToEnd = 0
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Generates an ANSI escape sequence to erase parts of the display (ED - Erase in Display).
|
|
40
|
+
* The specific sequence is `CSI <mode>J`, where `<mode>` is a parameter from {@link EraseDisplayMode}.
|
|
41
|
+
*
|
|
42
|
+
* - If `mode` is `EraseDisplayMode.ToEnd` (or `0`), the sequence can be shortened to `CSI J`.
|
|
43
|
+
* - The function validates the input `mode`. If an invalid number is provided, it defaults to `EraseDisplayMode.ToEnd`.
|
|
44
|
+
* @param mode The erase mode, specified as a value from `EraseDisplayMode` or its corresponding number (0, 1, 2, 3).
|
|
45
|
+
* @returns The ANSI escape sequence string for erasing in display.
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* import { eraseDisplay, EraseDisplayMode } from '@visulima/ansi/erase';
|
|
49
|
+
*
|
|
50
|
+
* // Erase from cursor to end of screen
|
|
51
|
+
* process.stdout.write(eraseDisplay(EraseDisplayMode.ToEnd)); // or eraseDisplay(0)
|
|
52
|
+
*
|
|
53
|
+
* // Erase entire screen
|
|
54
|
+
* process.stdout.write(eraseDisplay(EraseDisplayMode.EntireScreen)); // or eraseDisplay(2)
|
|
55
|
+
*
|
|
56
|
+
* // Erase entire screen and scrollback buffer
|
|
57
|
+
* process.stdout.write(eraseDisplay(EraseDisplayMode.EntireScreenAndScrollback)); // or eraseDisplay(3)
|
|
58
|
+
* ```
|
|
59
|
+
* @see {@link EraseDisplayMode}
|
|
60
|
+
* @see {@link https://vt100.net/docs/vt510-rm/ED.html} VT510 Erase in Display (ED) documentation.
|
|
61
|
+
*/
|
|
62
|
+
export declare const eraseDisplay: (mode: EraseDisplayMode | 0 | 1 | 2 | 3) => string;
|
|
63
|
+
/**
|
|
64
|
+
* Defines the modes for erasing parts of the current line using the EL (Erase in Line) sequence.
|
|
65
|
+
* The EL sequence is `CSI Ps K`, where `Ps` is one of these mode values.
|
|
66
|
+
* The cursor position is NOT affected by EL sequences.
|
|
67
|
+
* @see {@link eraseInLine} for the function that generates EL sequences.
|
|
68
|
+
* @see {@link https://vt100.net/docs/vt510-rm/EL.html} VT510 Erase in Line (EL) documentation.
|
|
69
|
+
* @enum {number}
|
|
70
|
+
*/
|
|
71
|
+
export declare enum EraseLineMode {
|
|
72
|
+
/**
|
|
73
|
+
* Clears the entire current line.
|
|
74
|
+
* This corresponds to `Ps=2` in `CSI Ps K`.
|
|
75
|
+
* Sequence: `CSI 2K`.
|
|
76
|
+
*/
|
|
77
|
+
EntireLine = 2,
|
|
78
|
+
/**
|
|
79
|
+
* Clears from the beginning of the line to the current cursor position (inclusive).
|
|
80
|
+
* This corresponds to `Ps=1` in `CSI Ps K`.
|
|
81
|
+
* Sequence: `CSI 1K`.
|
|
82
|
+
*/
|
|
83
|
+
ToBeginning = 1,
|
|
84
|
+
/**
|
|
85
|
+
* Clears from the current cursor position to the end of the line (inclusive).
|
|
86
|
+
* This corresponds to `Ps=0` (or `Ps` omitted) in `CSI Ps K`.
|
|
87
|
+
* Sequence: `CSI K` or `CSI 0K`.
|
|
88
|
+
*/
|
|
89
|
+
ToEnd = 0
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Generates an ANSI escape sequence to erase parts of the current line (EL - Erase in Line).
|
|
93
|
+
* The specific sequence is `CSI <mode>K`, where `<mode>` is a parameter from {@link EraseLineMode}.
|
|
94
|
+
* The cursor position is NOT changed by this sequence.
|
|
95
|
+
*
|
|
96
|
+
* - If `mode` is `EraseLineMode.ToEnd` (or `0`), the sequence can be shortened to `CSI K`.
|
|
97
|
+
* - The function validates the input `mode`. If an invalid number is provided, it defaults to `EraseLineMode.ToEnd`.
|
|
98
|
+
* @param mode The erase mode, specified as a value from `EraseLineMode` or its corresponding number (0, 1, 2).
|
|
99
|
+
* @returns The ANSI escape sequence string for erasing in line.
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* import { eraseInLine, EraseLineMode } from '@visulima/ansi/erase';
|
|
103
|
+
*
|
|
104
|
+
* // Erase from cursor to end of line
|
|
105
|
+
* process.stdout.write(eraseInLine(EraseLineMode.ToEnd)); // or eraseInLine(0)
|
|
106
|
+
*
|
|
107
|
+
* // Erase entire current line
|
|
108
|
+
* process.stdout.write(eraseInLine(EraseLineMode.EntireLine)); // or eraseInLine(2)
|
|
109
|
+
* ```
|
|
110
|
+
* @see {@link EraseLineMode}
|
|
111
|
+
* @see {@link https://vt100.net/docs/vt510-rm/EL.html} VT510 Erase in Line (EL) documentation.
|
|
112
|
+
*/
|
|
113
|
+
export declare const eraseInLine: (mode: EraseLineMode | 0 | 1 | 2) => string;
|
|
114
|
+
/**
|
|
115
|
+
* Erases the screen from the current cursor position down to the bottom of the screen (inclusive).
|
|
116
|
+
* This is a convenience constant for `eraseDisplay(EraseDisplayMode.ToEnd)`.
|
|
117
|
+
* Sequence: `CSI J` (or `CSI 0J`).
|
|
118
|
+
* @returns The ANSI escape sequence `CSI J`.
|
|
119
|
+
* @see {@link eraseDisplay}
|
|
120
|
+
* @see {@link EraseDisplayMode.ToEnd}
|
|
121
|
+
*/
|
|
122
|
+
export declare const eraseDown: string;
|
|
123
|
+
/**
|
|
124
|
+
* Erases the entire current line. The cursor position does not change.
|
|
125
|
+
* This is a convenience constant for `eraseInLine(EraseLineMode.EntireLine)`.
|
|
126
|
+
* Sequence: `CSI 2K`.
|
|
127
|
+
* @returns The ANSI escape sequence `CSI 2K`.
|
|
128
|
+
* @see {@link eraseInLine}
|
|
129
|
+
* @see {@link EraseLineMode.EntireLine}
|
|
130
|
+
*/
|
|
131
|
+
export declare const eraseLine: string;
|
|
132
|
+
/**
|
|
133
|
+
* Erases from the current cursor position to the end of the current line (inclusive).
|
|
134
|
+
* The cursor position does not change.
|
|
135
|
+
* This is a convenience constant for `eraseInLine(EraseLineMode.ToEnd)`.
|
|
136
|
+
* Sequence: `CSI K` (or `CSI 0K`).
|
|
137
|
+
* @returns The ANSI escape sequence `CSI K`.
|
|
138
|
+
* @see {@link eraseInLine}
|
|
139
|
+
* @see {@link EraseLineMode.ToEnd}
|
|
140
|
+
*/
|
|
141
|
+
export declare const eraseLineEnd: string;
|
|
142
|
+
/**
|
|
143
|
+
* Erases from the current cursor position to the beginning of the current line (inclusive).
|
|
144
|
+
* The cursor position does not change.
|
|
145
|
+
* This is a convenience constant for `eraseInLine(EraseLineMode.ToBeginning)`.
|
|
146
|
+
* Sequence: `CSI 1K`.
|
|
147
|
+
* @returns The ANSI escape sequence `CSI 1K`.
|
|
148
|
+
* @see {@link eraseInLine}
|
|
149
|
+
* @see {@link EraseLineMode.ToBeginning}
|
|
150
|
+
*/
|
|
151
|
+
export declare const eraseLineStart: string;
|
|
152
|
+
/**
|
|
153
|
+
* Erases a specified number of lines, starting from the current line and moving upwards,
|
|
154
|
+
* then moves the cursor to the beginning of the topmost erased line (which becomes the new current line).
|
|
155
|
+
*
|
|
156
|
+
* This is a custom helper function, not a single standard ANSI/VT sequence. It combines
|
|
157
|
+
* multiple sequences: {@link eraseLine} to clear each line, {@link cursorUp} to move to the line above,
|
|
158
|
+
* and finally {@link cursorToColumn1} to position the cursor at the start of the resulting current line.
|
|
159
|
+
* @param count The total number of lines to erase. This includes the current line and `count-1` lines above it.
|
|
160
|
+
* If `count` is 0 or negative, an empty string is returned (no operation).
|
|
161
|
+
* @returns A string of concatenated ANSI escape sequences to perform the operation.
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* import { eraseLines } from '@visulima/ansi/erase';
|
|
165
|
+
*
|
|
166
|
+
* // To erase the current line and the 2 lines above it (total 3 lines):
|
|
167
|
+
* process.stdout.write(eraseLines(3));
|
|
168
|
+
* // Conceptual sequence of operations:
|
|
169
|
+
* // 1. Erase current line
|
|
170
|
+
* // 2. Cursor up
|
|
171
|
+
* // 3. Erase current line (which was the line above the original)
|
|
172
|
+
* // 4. Cursor up
|
|
173
|
+
* // 5. Erase current line (which was two lines above the original)
|
|
174
|
+
* // 6. Cursor to column 1 (on this topmost erased line)
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
export declare const eraseLines: (count: number) => string;
|
|
178
|
+
/**
|
|
179
|
+
* Erases the entire screen. The cursor position usually does not change, though this can be terminal-dependent.
|
|
180
|
+
* This is a convenience constant for `eraseDisplay(EraseDisplayMode.EntireScreen)`.
|
|
181
|
+
* Sequence: `CSI 2J`.
|
|
182
|
+
* @returns The ANSI escape sequence `CSI 2J`.
|
|
183
|
+
* @see {@link eraseDisplay}
|
|
184
|
+
* @see {@link EraseDisplayMode.EntireScreen}
|
|
185
|
+
*/
|
|
186
|
+
export declare const eraseScreen: string;
|
|
187
|
+
/**
|
|
188
|
+
* Erases the screen from the current cursor position up to the top of the screen (inclusive).
|
|
189
|
+
* This is a convenience constant for `eraseDisplay(EraseDisplayMode.ToBeginning)`.
|
|
190
|
+
* Sequence: `CSI 1J`.
|
|
191
|
+
* @returns The ANSI escape sequence `CSI 1J`.
|
|
192
|
+
* @see {@link eraseDisplay}
|
|
193
|
+
* @see {@link EraseDisplayMode.ToBeginning}
|
|
194
|
+
*/
|
|
195
|
+
export declare const eraseUp: string;
|
|
196
|
+
/**
|
|
197
|
+
* Erases the entire screen and, on supported terminals (like XTerm and derivatives),
|
|
198
|
+
* also deletes all lines saved in the scrollback buffer.
|
|
199
|
+
* This is a convenience constant for `eraseDisplay(EraseDisplayMode.EntireScreenAndScrollback)`.
|
|
200
|
+
* Sequence: `CSI 3J` (an XTerm extension, widely adopted).
|
|
201
|
+
* @returns The ANSI escape sequence `CSI 3J`.
|
|
202
|
+
* @remarks This mode is particularly useful for a more complete "reset" of the terminal view.
|
|
203
|
+
* @see {@link eraseDisplay}
|
|
204
|
+
* @see {@link EraseDisplayMode.EntireScreenAndScrollback}
|
|
205
|
+
*/
|
|
206
|
+
export declare const eraseScreenAndScrollback: string;
|
package/dist/erase.d.mts
CHANGED
|
@@ -1,9 +1,206 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Defines the modes for erasing parts of the display using the ED (Erase in Display) sequence.
|
|
3
|
+
* The ED sequence is `CSI Ps J`, where `Ps` is one of these mode values.
|
|
4
|
+
* @see {@link eraseDisplay} for the function that generates ED sequences.
|
|
5
|
+
* @see {@link https://vt100.net/docs/vt510-rm/ED.html} VT510 Erase in Display (ED) documentation.
|
|
6
|
+
* @enum {number}
|
|
7
|
+
*/
|
|
8
|
+
export declare enum EraseDisplayMode {
|
|
9
|
+
/**
|
|
10
|
+
* Clears the entire screen. The cursor position usually does not change, but this can be
|
|
11
|
+
* terminal-dependent. Some terminals might move the cursor to the home position (top-left).
|
|
12
|
+
* This corresponds to `Ps=2` in `CSI Ps J`.
|
|
13
|
+
* Sequence: `CSI 2J`.
|
|
14
|
+
*/
|
|
15
|
+
EntireScreen = 2,
|
|
16
|
+
/**
|
|
17
|
+
* Clears the entire screen and, on supported terminals (like XTerm and derivatives),
|
|
18
|
+
* also deletes all lines saved in the scrollback buffer.
|
|
19
|
+
* This corresponds to `Ps=3` in `CSI Ps J` (an XTerm extension, widely adopted).
|
|
20
|
+
* Sequence: `CSI 3J`.
|
|
21
|
+
* @remarks This mode is particularly useful for a more complete "reset" of the terminal view.
|
|
22
|
+
*/
|
|
23
|
+
EntireScreenAndScrollback = 3,
|
|
24
|
+
/**
|
|
25
|
+
* Clears from the beginning of the screen to the current cursor position (inclusive).
|
|
26
|
+
* This corresponds to `Ps=1` in `CSI Ps J`.
|
|
27
|
+
* Sequence: `CSI 1J`.
|
|
28
|
+
*/
|
|
29
|
+
ToBeginning = 1,
|
|
30
|
+
/**
|
|
31
|
+
* Clears from the current cursor position to the end of the screen (inclusive).
|
|
32
|
+
* If the cursor is at the top-left, this clears the entire screen.
|
|
33
|
+
* This corresponds to `Ps=0` (or `Ps` omitted) in `CSI Ps J`.
|
|
34
|
+
* Sequence: `CSI J` or `CSI 0J`.
|
|
35
|
+
*/
|
|
36
|
+
ToEnd = 0
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Generates an ANSI escape sequence to erase parts of the display (ED - Erase in Display).
|
|
40
|
+
* The specific sequence is `CSI <mode>J`, where `<mode>` is a parameter from {@link EraseDisplayMode}.
|
|
41
|
+
*
|
|
42
|
+
* - If `mode` is `EraseDisplayMode.ToEnd` (or `0`), the sequence can be shortened to `CSI J`.
|
|
43
|
+
* - The function validates the input `mode`. If an invalid number is provided, it defaults to `EraseDisplayMode.ToEnd`.
|
|
44
|
+
* @param mode The erase mode, specified as a value from `EraseDisplayMode` or its corresponding number (0, 1, 2, 3).
|
|
45
|
+
* @returns The ANSI escape sequence string for erasing in display.
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* import { eraseDisplay, EraseDisplayMode } from '@visulima/ansi/erase';
|
|
49
|
+
*
|
|
50
|
+
* // Erase from cursor to end of screen
|
|
51
|
+
* process.stdout.write(eraseDisplay(EraseDisplayMode.ToEnd)); // or eraseDisplay(0)
|
|
52
|
+
*
|
|
53
|
+
* // Erase entire screen
|
|
54
|
+
* process.stdout.write(eraseDisplay(EraseDisplayMode.EntireScreen)); // or eraseDisplay(2)
|
|
55
|
+
*
|
|
56
|
+
* // Erase entire screen and scrollback buffer
|
|
57
|
+
* process.stdout.write(eraseDisplay(EraseDisplayMode.EntireScreenAndScrollback)); // or eraseDisplay(3)
|
|
58
|
+
* ```
|
|
59
|
+
* @see {@link EraseDisplayMode}
|
|
60
|
+
* @see {@link https://vt100.net/docs/vt510-rm/ED.html} VT510 Erase in Display (ED) documentation.
|
|
61
|
+
*/
|
|
62
|
+
export declare const eraseDisplay: (mode: EraseDisplayMode | 0 | 1 | 2 | 3) => string;
|
|
63
|
+
/**
|
|
64
|
+
* Defines the modes for erasing parts of the current line using the EL (Erase in Line) sequence.
|
|
65
|
+
* The EL sequence is `CSI Ps K`, where `Ps` is one of these mode values.
|
|
66
|
+
* The cursor position is NOT affected by EL sequences.
|
|
67
|
+
* @see {@link eraseInLine} for the function that generates EL sequences.
|
|
68
|
+
* @see {@link https://vt100.net/docs/vt510-rm/EL.html} VT510 Erase in Line (EL) documentation.
|
|
69
|
+
* @enum {number}
|
|
70
|
+
*/
|
|
71
|
+
export declare enum EraseLineMode {
|
|
72
|
+
/**
|
|
73
|
+
* Clears the entire current line.
|
|
74
|
+
* This corresponds to `Ps=2` in `CSI Ps K`.
|
|
75
|
+
* Sequence: `CSI 2K`.
|
|
76
|
+
*/
|
|
77
|
+
EntireLine = 2,
|
|
78
|
+
/**
|
|
79
|
+
* Clears from the beginning of the line to the current cursor position (inclusive).
|
|
80
|
+
* This corresponds to `Ps=1` in `CSI Ps K`.
|
|
81
|
+
* Sequence: `CSI 1K`.
|
|
82
|
+
*/
|
|
83
|
+
ToBeginning = 1,
|
|
84
|
+
/**
|
|
85
|
+
* Clears from the current cursor position to the end of the line (inclusive).
|
|
86
|
+
* This corresponds to `Ps=0` (or `Ps` omitted) in `CSI Ps K`.
|
|
87
|
+
* Sequence: `CSI K` or `CSI 0K`.
|
|
88
|
+
*/
|
|
89
|
+
ToEnd = 0
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Generates an ANSI escape sequence to erase parts of the current line (EL - Erase in Line).
|
|
93
|
+
* The specific sequence is `CSI <mode>K`, where `<mode>` is a parameter from {@link EraseLineMode}.
|
|
94
|
+
* The cursor position is NOT changed by this sequence.
|
|
95
|
+
*
|
|
96
|
+
* - If `mode` is `EraseLineMode.ToEnd` (or `0`), the sequence can be shortened to `CSI K`.
|
|
97
|
+
* - The function validates the input `mode`. If an invalid number is provided, it defaults to `EraseLineMode.ToEnd`.
|
|
98
|
+
* @param mode The erase mode, specified as a value from `EraseLineMode` or its corresponding number (0, 1, 2).
|
|
99
|
+
* @returns The ANSI escape sequence string for erasing in line.
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* import { eraseInLine, EraseLineMode } from '@visulima/ansi/erase';
|
|
103
|
+
*
|
|
104
|
+
* // Erase from cursor to end of line
|
|
105
|
+
* process.stdout.write(eraseInLine(EraseLineMode.ToEnd)); // or eraseInLine(0)
|
|
106
|
+
*
|
|
107
|
+
* // Erase entire current line
|
|
108
|
+
* process.stdout.write(eraseInLine(EraseLineMode.EntireLine)); // or eraseInLine(2)
|
|
109
|
+
* ```
|
|
110
|
+
* @see {@link EraseLineMode}
|
|
111
|
+
* @see {@link https://vt100.net/docs/vt510-rm/EL.html} VT510 Erase in Line (EL) documentation.
|
|
112
|
+
*/
|
|
113
|
+
export declare const eraseInLine: (mode: EraseLineMode | 0 | 1 | 2) => string;
|
|
114
|
+
/**
|
|
115
|
+
* Erases the screen from the current cursor position down to the bottom of the screen (inclusive).
|
|
116
|
+
* This is a convenience constant for `eraseDisplay(EraseDisplayMode.ToEnd)`.
|
|
117
|
+
* Sequence: `CSI J` (or `CSI 0J`).
|
|
118
|
+
* @returns The ANSI escape sequence `CSI J`.
|
|
119
|
+
* @see {@link eraseDisplay}
|
|
120
|
+
* @see {@link EraseDisplayMode.ToEnd}
|
|
121
|
+
*/
|
|
122
|
+
export declare const eraseDown: string;
|
|
123
|
+
/**
|
|
124
|
+
* Erases the entire current line. The cursor position does not change.
|
|
125
|
+
* This is a convenience constant for `eraseInLine(EraseLineMode.EntireLine)`.
|
|
126
|
+
* Sequence: `CSI 2K`.
|
|
127
|
+
* @returns The ANSI escape sequence `CSI 2K`.
|
|
128
|
+
* @see {@link eraseInLine}
|
|
129
|
+
* @see {@link EraseLineMode.EntireLine}
|
|
130
|
+
*/
|
|
131
|
+
export declare const eraseLine: string;
|
|
132
|
+
/**
|
|
133
|
+
* Erases from the current cursor position to the end of the current line (inclusive).
|
|
134
|
+
* The cursor position does not change.
|
|
135
|
+
* This is a convenience constant for `eraseInLine(EraseLineMode.ToEnd)`.
|
|
136
|
+
* Sequence: `CSI K` (or `CSI 0K`).
|
|
137
|
+
* @returns The ANSI escape sequence `CSI K`.
|
|
138
|
+
* @see {@link eraseInLine}
|
|
139
|
+
* @see {@link EraseLineMode.ToEnd}
|
|
140
|
+
*/
|
|
141
|
+
export declare const eraseLineEnd: string;
|
|
142
|
+
/**
|
|
143
|
+
* Erases from the current cursor position to the beginning of the current line (inclusive).
|
|
144
|
+
* The cursor position does not change.
|
|
145
|
+
* This is a convenience constant for `eraseInLine(EraseLineMode.ToBeginning)`.
|
|
146
|
+
* Sequence: `CSI 1K`.
|
|
147
|
+
* @returns The ANSI escape sequence `CSI 1K`.
|
|
148
|
+
* @see {@link eraseInLine}
|
|
149
|
+
* @see {@link EraseLineMode.ToBeginning}
|
|
150
|
+
*/
|
|
151
|
+
export declare const eraseLineStart: string;
|
|
152
|
+
/**
|
|
153
|
+
* Erases a specified number of lines, starting from the current line and moving upwards,
|
|
154
|
+
* then moves the cursor to the beginning of the topmost erased line (which becomes the new current line).
|
|
155
|
+
*
|
|
156
|
+
* This is a custom helper function, not a single standard ANSI/VT sequence. It combines
|
|
157
|
+
* multiple sequences: {@link eraseLine} to clear each line, {@link cursorUp} to move to the line above,
|
|
158
|
+
* and finally {@link cursorToColumn1} to position the cursor at the start of the resulting current line.
|
|
159
|
+
* @param count The total number of lines to erase. This includes the current line and `count-1` lines above it.
|
|
160
|
+
* If `count` is 0 or negative, an empty string is returned (no operation).
|
|
161
|
+
* @returns A string of concatenated ANSI escape sequences to perform the operation.
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* import { eraseLines } from '@visulima/ansi/erase';
|
|
165
|
+
*
|
|
166
|
+
* // To erase the current line and the 2 lines above it (total 3 lines):
|
|
167
|
+
* process.stdout.write(eraseLines(3));
|
|
168
|
+
* // Conceptual sequence of operations:
|
|
169
|
+
* // 1. Erase current line
|
|
170
|
+
* // 2. Cursor up
|
|
171
|
+
* // 3. Erase current line (which was the line above the original)
|
|
172
|
+
* // 4. Cursor up
|
|
173
|
+
* // 5. Erase current line (which was two lines above the original)
|
|
174
|
+
* // 6. Cursor to column 1 (on this topmost erased line)
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
export declare const eraseLines: (count: number) => string;
|
|
178
|
+
/**
|
|
179
|
+
* Erases the entire screen. The cursor position usually does not change, though this can be terminal-dependent.
|
|
180
|
+
* This is a convenience constant for `eraseDisplay(EraseDisplayMode.EntireScreen)`.
|
|
181
|
+
* Sequence: `CSI 2J`.
|
|
182
|
+
* @returns The ANSI escape sequence `CSI 2J`.
|
|
183
|
+
* @see {@link eraseDisplay}
|
|
184
|
+
* @see {@link EraseDisplayMode.EntireScreen}
|
|
185
|
+
*/
|
|
186
|
+
export declare const eraseScreen: string;
|
|
187
|
+
/**
|
|
188
|
+
* Erases the screen from the current cursor position up to the top of the screen (inclusive).
|
|
189
|
+
* This is a convenience constant for `eraseDisplay(EraseDisplayMode.ToBeginning)`.
|
|
190
|
+
* Sequence: `CSI 1J`.
|
|
191
|
+
* @returns The ANSI escape sequence `CSI 1J`.
|
|
192
|
+
* @see {@link eraseDisplay}
|
|
193
|
+
* @see {@link EraseDisplayMode.ToBeginning}
|
|
194
|
+
*/
|
|
195
|
+
export declare const eraseUp: string;
|
|
196
|
+
/**
|
|
197
|
+
* Erases the entire screen and, on supported terminals (like XTerm and derivatives),
|
|
198
|
+
* also deletes all lines saved in the scrollback buffer.
|
|
199
|
+
* This is a convenience constant for `eraseDisplay(EraseDisplayMode.EntireScreenAndScrollback)`.
|
|
200
|
+
* Sequence: `CSI 3J` (an XTerm extension, widely adopted).
|
|
201
|
+
* @returns The ANSI escape sequence `CSI 3J`.
|
|
202
|
+
* @remarks This mode is particularly useful for a more complete "reset" of the terminal view.
|
|
203
|
+
* @see {@link eraseDisplay}
|
|
204
|
+
* @see {@link EraseDisplayMode.EntireScreenAndScrollback}
|
|
205
|
+
*/
|
|
206
|
+
export declare const eraseScreenAndScrollback: string;
|
package/dist/erase.d.ts
CHANGED
|
@@ -1,9 +1,206 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Defines the modes for erasing parts of the display using the ED (Erase in Display) sequence.
|
|
3
|
+
* The ED sequence is `CSI Ps J`, where `Ps` is one of these mode values.
|
|
4
|
+
* @see {@link eraseDisplay} for the function that generates ED sequences.
|
|
5
|
+
* @see {@link https://vt100.net/docs/vt510-rm/ED.html} VT510 Erase in Display (ED) documentation.
|
|
6
|
+
* @enum {number}
|
|
7
|
+
*/
|
|
8
|
+
export declare enum EraseDisplayMode {
|
|
9
|
+
/**
|
|
10
|
+
* Clears the entire screen. The cursor position usually does not change, but this can be
|
|
11
|
+
* terminal-dependent. Some terminals might move the cursor to the home position (top-left).
|
|
12
|
+
* This corresponds to `Ps=2` in `CSI Ps J`.
|
|
13
|
+
* Sequence: `CSI 2J`.
|
|
14
|
+
*/
|
|
15
|
+
EntireScreen = 2,
|
|
16
|
+
/**
|
|
17
|
+
* Clears the entire screen and, on supported terminals (like XTerm and derivatives),
|
|
18
|
+
* also deletes all lines saved in the scrollback buffer.
|
|
19
|
+
* This corresponds to `Ps=3` in `CSI Ps J` (an XTerm extension, widely adopted).
|
|
20
|
+
* Sequence: `CSI 3J`.
|
|
21
|
+
* @remarks This mode is particularly useful for a more complete "reset" of the terminal view.
|
|
22
|
+
*/
|
|
23
|
+
EntireScreenAndScrollback = 3,
|
|
24
|
+
/**
|
|
25
|
+
* Clears from the beginning of the screen to the current cursor position (inclusive).
|
|
26
|
+
* This corresponds to `Ps=1` in `CSI Ps J`.
|
|
27
|
+
* Sequence: `CSI 1J`.
|
|
28
|
+
*/
|
|
29
|
+
ToBeginning = 1,
|
|
30
|
+
/**
|
|
31
|
+
* Clears from the current cursor position to the end of the screen (inclusive).
|
|
32
|
+
* If the cursor is at the top-left, this clears the entire screen.
|
|
33
|
+
* This corresponds to `Ps=0` (or `Ps` omitted) in `CSI Ps J`.
|
|
34
|
+
* Sequence: `CSI J` or `CSI 0J`.
|
|
35
|
+
*/
|
|
36
|
+
ToEnd = 0
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Generates an ANSI escape sequence to erase parts of the display (ED - Erase in Display).
|
|
40
|
+
* The specific sequence is `CSI <mode>J`, where `<mode>` is a parameter from {@link EraseDisplayMode}.
|
|
41
|
+
*
|
|
42
|
+
* - If `mode` is `EraseDisplayMode.ToEnd` (or `0`), the sequence can be shortened to `CSI J`.
|
|
43
|
+
* - The function validates the input `mode`. If an invalid number is provided, it defaults to `EraseDisplayMode.ToEnd`.
|
|
44
|
+
* @param mode The erase mode, specified as a value from `EraseDisplayMode` or its corresponding number (0, 1, 2, 3).
|
|
45
|
+
* @returns The ANSI escape sequence string for erasing in display.
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* import { eraseDisplay, EraseDisplayMode } from '@visulima/ansi/erase';
|
|
49
|
+
*
|
|
50
|
+
* // Erase from cursor to end of screen
|
|
51
|
+
* process.stdout.write(eraseDisplay(EraseDisplayMode.ToEnd)); // or eraseDisplay(0)
|
|
52
|
+
*
|
|
53
|
+
* // Erase entire screen
|
|
54
|
+
* process.stdout.write(eraseDisplay(EraseDisplayMode.EntireScreen)); // or eraseDisplay(2)
|
|
55
|
+
*
|
|
56
|
+
* // Erase entire screen and scrollback buffer
|
|
57
|
+
* process.stdout.write(eraseDisplay(EraseDisplayMode.EntireScreenAndScrollback)); // or eraseDisplay(3)
|
|
58
|
+
* ```
|
|
59
|
+
* @see {@link EraseDisplayMode}
|
|
60
|
+
* @see {@link https://vt100.net/docs/vt510-rm/ED.html} VT510 Erase in Display (ED) documentation.
|
|
61
|
+
*/
|
|
62
|
+
export declare const eraseDisplay: (mode: EraseDisplayMode | 0 | 1 | 2 | 3) => string;
|
|
63
|
+
/**
|
|
64
|
+
* Defines the modes for erasing parts of the current line using the EL (Erase in Line) sequence.
|
|
65
|
+
* The EL sequence is `CSI Ps K`, where `Ps` is one of these mode values.
|
|
66
|
+
* The cursor position is NOT affected by EL sequences.
|
|
67
|
+
* @see {@link eraseInLine} for the function that generates EL sequences.
|
|
68
|
+
* @see {@link https://vt100.net/docs/vt510-rm/EL.html} VT510 Erase in Line (EL) documentation.
|
|
69
|
+
* @enum {number}
|
|
70
|
+
*/
|
|
71
|
+
export declare enum EraseLineMode {
|
|
72
|
+
/**
|
|
73
|
+
* Clears the entire current line.
|
|
74
|
+
* This corresponds to `Ps=2` in `CSI Ps K`.
|
|
75
|
+
* Sequence: `CSI 2K`.
|
|
76
|
+
*/
|
|
77
|
+
EntireLine = 2,
|
|
78
|
+
/**
|
|
79
|
+
* Clears from the beginning of the line to the current cursor position (inclusive).
|
|
80
|
+
* This corresponds to `Ps=1` in `CSI Ps K`.
|
|
81
|
+
* Sequence: `CSI 1K`.
|
|
82
|
+
*/
|
|
83
|
+
ToBeginning = 1,
|
|
84
|
+
/**
|
|
85
|
+
* Clears from the current cursor position to the end of the line (inclusive).
|
|
86
|
+
* This corresponds to `Ps=0` (or `Ps` omitted) in `CSI Ps K`.
|
|
87
|
+
* Sequence: `CSI K` or `CSI 0K`.
|
|
88
|
+
*/
|
|
89
|
+
ToEnd = 0
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Generates an ANSI escape sequence to erase parts of the current line (EL - Erase in Line).
|
|
93
|
+
* The specific sequence is `CSI <mode>K`, where `<mode>` is a parameter from {@link EraseLineMode}.
|
|
94
|
+
* The cursor position is NOT changed by this sequence.
|
|
95
|
+
*
|
|
96
|
+
* - If `mode` is `EraseLineMode.ToEnd` (or `0`), the sequence can be shortened to `CSI K`.
|
|
97
|
+
* - The function validates the input `mode`. If an invalid number is provided, it defaults to `EraseLineMode.ToEnd`.
|
|
98
|
+
* @param mode The erase mode, specified as a value from `EraseLineMode` or its corresponding number (0, 1, 2).
|
|
99
|
+
* @returns The ANSI escape sequence string for erasing in line.
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* import { eraseInLine, EraseLineMode } from '@visulima/ansi/erase';
|
|
103
|
+
*
|
|
104
|
+
* // Erase from cursor to end of line
|
|
105
|
+
* process.stdout.write(eraseInLine(EraseLineMode.ToEnd)); // or eraseInLine(0)
|
|
106
|
+
*
|
|
107
|
+
* // Erase entire current line
|
|
108
|
+
* process.stdout.write(eraseInLine(EraseLineMode.EntireLine)); // or eraseInLine(2)
|
|
109
|
+
* ```
|
|
110
|
+
* @see {@link EraseLineMode}
|
|
111
|
+
* @see {@link https://vt100.net/docs/vt510-rm/EL.html} VT510 Erase in Line (EL) documentation.
|
|
112
|
+
*/
|
|
113
|
+
export declare const eraseInLine: (mode: EraseLineMode | 0 | 1 | 2) => string;
|
|
114
|
+
/**
|
|
115
|
+
* Erases the screen from the current cursor position down to the bottom of the screen (inclusive).
|
|
116
|
+
* This is a convenience constant for `eraseDisplay(EraseDisplayMode.ToEnd)`.
|
|
117
|
+
* Sequence: `CSI J` (or `CSI 0J`).
|
|
118
|
+
* @returns The ANSI escape sequence `CSI J`.
|
|
119
|
+
* @see {@link eraseDisplay}
|
|
120
|
+
* @see {@link EraseDisplayMode.ToEnd}
|
|
121
|
+
*/
|
|
122
|
+
export declare const eraseDown: string;
|
|
123
|
+
/**
|
|
124
|
+
* Erases the entire current line. The cursor position does not change.
|
|
125
|
+
* This is a convenience constant for `eraseInLine(EraseLineMode.EntireLine)`.
|
|
126
|
+
* Sequence: `CSI 2K`.
|
|
127
|
+
* @returns The ANSI escape sequence `CSI 2K`.
|
|
128
|
+
* @see {@link eraseInLine}
|
|
129
|
+
* @see {@link EraseLineMode.EntireLine}
|
|
130
|
+
*/
|
|
131
|
+
export declare const eraseLine: string;
|
|
132
|
+
/**
|
|
133
|
+
* Erases from the current cursor position to the end of the current line (inclusive).
|
|
134
|
+
* The cursor position does not change.
|
|
135
|
+
* This is a convenience constant for `eraseInLine(EraseLineMode.ToEnd)`.
|
|
136
|
+
* Sequence: `CSI K` (or `CSI 0K`).
|
|
137
|
+
* @returns The ANSI escape sequence `CSI K`.
|
|
138
|
+
* @see {@link eraseInLine}
|
|
139
|
+
* @see {@link EraseLineMode.ToEnd}
|
|
140
|
+
*/
|
|
141
|
+
export declare const eraseLineEnd: string;
|
|
142
|
+
/**
|
|
143
|
+
* Erases from the current cursor position to the beginning of the current line (inclusive).
|
|
144
|
+
* The cursor position does not change.
|
|
145
|
+
* This is a convenience constant for `eraseInLine(EraseLineMode.ToBeginning)`.
|
|
146
|
+
* Sequence: `CSI 1K`.
|
|
147
|
+
* @returns The ANSI escape sequence `CSI 1K`.
|
|
148
|
+
* @see {@link eraseInLine}
|
|
149
|
+
* @see {@link EraseLineMode.ToBeginning}
|
|
150
|
+
*/
|
|
151
|
+
export declare const eraseLineStart: string;
|
|
152
|
+
/**
|
|
153
|
+
* Erases a specified number of lines, starting from the current line and moving upwards,
|
|
154
|
+
* then moves the cursor to the beginning of the topmost erased line (which becomes the new current line).
|
|
155
|
+
*
|
|
156
|
+
* This is a custom helper function, not a single standard ANSI/VT sequence. It combines
|
|
157
|
+
* multiple sequences: {@link eraseLine} to clear each line, {@link cursorUp} to move to the line above,
|
|
158
|
+
* and finally {@link cursorToColumn1} to position the cursor at the start of the resulting current line.
|
|
159
|
+
* @param count The total number of lines to erase. This includes the current line and `count-1` lines above it.
|
|
160
|
+
* If `count` is 0 or negative, an empty string is returned (no operation).
|
|
161
|
+
* @returns A string of concatenated ANSI escape sequences to perform the operation.
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* import { eraseLines } from '@visulima/ansi/erase';
|
|
165
|
+
*
|
|
166
|
+
* // To erase the current line and the 2 lines above it (total 3 lines):
|
|
167
|
+
* process.stdout.write(eraseLines(3));
|
|
168
|
+
* // Conceptual sequence of operations:
|
|
169
|
+
* // 1. Erase current line
|
|
170
|
+
* // 2. Cursor up
|
|
171
|
+
* // 3. Erase current line (which was the line above the original)
|
|
172
|
+
* // 4. Cursor up
|
|
173
|
+
* // 5. Erase current line (which was two lines above the original)
|
|
174
|
+
* // 6. Cursor to column 1 (on this topmost erased line)
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
export declare const eraseLines: (count: number) => string;
|
|
178
|
+
/**
|
|
179
|
+
* Erases the entire screen. The cursor position usually does not change, though this can be terminal-dependent.
|
|
180
|
+
* This is a convenience constant for `eraseDisplay(EraseDisplayMode.EntireScreen)`.
|
|
181
|
+
* Sequence: `CSI 2J`.
|
|
182
|
+
* @returns The ANSI escape sequence `CSI 2J`.
|
|
183
|
+
* @see {@link eraseDisplay}
|
|
184
|
+
* @see {@link EraseDisplayMode.EntireScreen}
|
|
185
|
+
*/
|
|
186
|
+
export declare const eraseScreen: string;
|
|
187
|
+
/**
|
|
188
|
+
* Erases the screen from the current cursor position up to the top of the screen (inclusive).
|
|
189
|
+
* This is a convenience constant for `eraseDisplay(EraseDisplayMode.ToBeginning)`.
|
|
190
|
+
* Sequence: `CSI 1J`.
|
|
191
|
+
* @returns The ANSI escape sequence `CSI 1J`.
|
|
192
|
+
* @see {@link eraseDisplay}
|
|
193
|
+
* @see {@link EraseDisplayMode.ToBeginning}
|
|
194
|
+
*/
|
|
195
|
+
export declare const eraseUp: string;
|
|
196
|
+
/**
|
|
197
|
+
* Erases the entire screen and, on supported terminals (like XTerm and derivatives),
|
|
198
|
+
* also deletes all lines saved in the scrollback buffer.
|
|
199
|
+
* This is a convenience constant for `eraseDisplay(EraseDisplayMode.EntireScreenAndScrollback)`.
|
|
200
|
+
* Sequence: `CSI 3J` (an XTerm extension, widely adopted).
|
|
201
|
+
* @returns The ANSI escape sequence `CSI 3J`.
|
|
202
|
+
* @remarks This mode is particularly useful for a more complete "reset" of the terminal view.
|
|
203
|
+
* @see {@link eraseDisplay}
|
|
204
|
+
* @see {@link EraseDisplayMode.EntireScreenAndScrollback}
|
|
205
|
+
*/
|
|
206
|
+
export declare const eraseScreenAndScrollback: string;
|