@visulima/ansi 4.0.0-alpha.13 → 4.0.0-alpha.14
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 +15 -0
- package/LICENSE.md +0 -3
- package/README.md +3 -0
- package/dist/alternative-screen.d.ts +71 -70
- package/dist/alternative-screen.js +1 -8
- package/dist/clear.d.ts +74 -73
- package/dist/clear.js +1 -10
- package/dist/cursor.d.ts +421 -406
- package/dist/cursor.js +1 -3
- package/dist/erase.d.ts +193 -192
- package/dist/erase.js +1 -47
- package/dist/hyperlink.d.ts +25 -25
- package/dist/hyperlink.js +1 -5
- package/dist/image.d.ts +71 -70
- package/dist/image.js +1 -40
- package/dist/index.d.ts +65 -35
- package/dist/index.js +1 -26
- package/dist/iterm2.d.ts +285 -58
- package/dist/iterm2.js +1 -12
- package/dist/mode.d.ts +585 -584
- package/dist/mode.js +1 -245
- package/dist/mouse.d.ts +227 -226
- package/dist/mouse.js +1 -106
- package/dist/packem_shared/IT2_AUTO-OiB8EaxU.js +1 -0
- package/dist/packem_shared/ITerm2File-XoC8RMzs.js +1 -0
- package/dist/packem_shared/constants-D12jy2Zh.js +1 -0
- package/dist/packem_shared/cursor-BAcJR4p_.js +1 -0
- package/dist/packem_shared/resetProgressBar-H_gzPKNE.js +1 -0
- package/dist/packem_shared/restoreCursor-CHy0jZuu.js +2 -0
- package/dist/passthrough.d.ts +74 -73
- package/dist/passthrough.js +1 -29
- package/dist/reset.d.ts +25 -24
- package/dist/reset.js +1 -4
- package/dist/screen.d.ts +226 -225
- package/dist/screen.js +1 -27
- package/dist/scroll.d.ts +64 -63
- package/dist/scroll.js +1 -18
- package/dist/status.d.ts +521 -520
- package/dist/status.js +1 -95
- package/dist/strip.d.ts +1 -1
- package/dist/strip.js +1 -13
- package/dist/termcap.d.ts +36 -35
- package/dist/termcap.js +1 -25
- package/dist/title.d.ts +176 -175
- package/dist/title.js +1 -19
- package/dist/window-ops.d.ts +399 -398
- package/dist/window-ops.js +1 -61
- package/dist/xterm.d.ts +85 -84
- package/dist/xterm.js +1 -33
- package/package.json +2 -5
- package/dist/constants.d.ts +0 -20
- package/dist/helpers.d.ts +0 -14
- package/dist/iterm2/iterm2-properties.d.ts +0 -135
- package/dist/iterm2/iterm2-sequences.d.ts +0 -96
- package/dist/packem_shared/IT2_AUTO-DyYWsxno.js +0 -6
- package/dist/packem_shared/ITerm2File-CUZDBk99.js +0 -137
- package/dist/packem_shared/constants-CE7WkXh_.js +0 -9
- package/dist/packem_shared/cursor-ChpV7cgs.js +0 -72
- package/dist/packem_shared/resetProgressBar-D9r2s7eV.js +0 -18
- package/dist/packem_shared/restoreCursor-GfYEeJqN.js +0 -323
- package/dist/progress.d.ts +0 -41
package/dist/window-ops.d.ts
CHANGED
|
@@ -1,418 +1,419 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
2
|
+
* Enum for XTerm Window Operations (XTWINOPS).
|
|
3
|
+
* These are parameters for the `CSI Ps ; Ps ; Ps t` sequence.
|
|
4
|
+
* @see {@link https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps;Ps;Ps-t.1EB0}
|
|
5
|
+
*/
|
|
6
|
+
declare enum XTermWindowOp {
|
|
7
|
+
/**
|
|
8
|
+
* De-iconify window.
|
|
9
|
+
*/
|
|
10
|
+
DEICONIFY_WINDOW = 1,
|
|
11
|
+
/**
|
|
12
|
+
* Iconify window.
|
|
13
|
+
*/
|
|
14
|
+
ICONIFY_WINDOW = 2,
|
|
15
|
+
/**
|
|
16
|
+
* Move window to `[x, y]`.
|
|
17
|
+
*/
|
|
18
|
+
MOVE_WINDOW = 3,
|
|
19
|
+
/**
|
|
20
|
+
* Resize the text area to `[height, width]` in characters.
|
|
21
|
+
*/
|
|
22
|
+
RESIZE_TEXT_AREA_CHARS = 4,
|
|
23
|
+
/**
|
|
24
|
+
* Raise the window to the front of the stacking order.
|
|
25
|
+
*/
|
|
26
|
+
RAISE_WINDOW = 5,
|
|
27
|
+
/**
|
|
28
|
+
* Lower the window to the bottom of the stacking order.
|
|
29
|
+
*/
|
|
30
|
+
LOWER_WINDOW = 6,
|
|
31
|
+
/**
|
|
32
|
+
* Refresh the window.
|
|
33
|
+
*/
|
|
34
|
+
REFRESH_WINDOW = 7,
|
|
35
|
+
/**
|
|
36
|
+
* Resize the text area to `[height, width]` in pixels.
|
|
37
|
+
*/
|
|
38
|
+
RESIZE_TEXT_AREA_PIXELS = 8,
|
|
39
|
+
/**
|
|
40
|
+
* Restore maximized window.
|
|
41
|
+
*/
|
|
42
|
+
RESTORE_MAXIMIZED_WINDOW = 9,
|
|
43
|
+
/**
|
|
44
|
+
* Maximize window (i.e., "zoom" or "toggle").
|
|
45
|
+
*/
|
|
46
|
+
MAXIMIZE_WINDOW = 10,
|
|
47
|
+
/**
|
|
48
|
+
* Maximize window vertically.
|
|
49
|
+
*/
|
|
50
|
+
MAXIMIZE_WINDOW_VERTICALLY = 10.1,
|
|
51
|
+
/**
|
|
52
|
+
* Maximize window horizontally.
|
|
53
|
+
*/
|
|
54
|
+
MAXIMIZE_WINDOW_HORIZONTALLY = 10.2,
|
|
55
|
+
/**
|
|
56
|
+
* Undo full-screen mode.
|
|
57
|
+
*/
|
|
58
|
+
UNDO_FULL_SCREEN_MODE = 10.3,
|
|
59
|
+
/**
|
|
60
|
+
* Report window state.
|
|
61
|
+
* Response: `CSI code t` where `code` is 1 if de-iconified, 2 if iconified.
|
|
62
|
+
*/
|
|
63
|
+
REPORT_WINDOW_STATE = 11,
|
|
64
|
+
/**
|
|
65
|
+
* Report window position.
|
|
66
|
+
* Response: `CSI 3 ; x ; y t`
|
|
67
|
+
*/
|
|
68
|
+
REPORT_WINDOW_POSITION = 13,
|
|
69
|
+
/**
|
|
70
|
+
* Report text area size in characters.
|
|
71
|
+
* Response: `CSI 4 ; height ; width t`
|
|
72
|
+
*/
|
|
73
|
+
REPORT_TEXT_AREA_SIZE_CHARS = 14,
|
|
74
|
+
/**
|
|
75
|
+
* Report window size in pixels.
|
|
76
|
+
* Alias for `REPORT_TEXT_AREA_SIZE_PIXELS` for compatibility with some terminals (e.g., mintty).
|
|
77
|
+
* Response: `CSI 4 ; height ; width t`
|
|
78
|
+
* Should be REPORT_TEXT_AREA_SIZE_PIXELS (18) for XTerm, but using Go's value.
|
|
79
|
+
*/
|
|
80
|
+
REQUEST_WINDOW_SIZE_WIN_OP_COMPAT = 14,
|
|
81
|
+
/**
|
|
82
|
+
* Report cell size in pixels.
|
|
83
|
+
* Response: `CSI 6 ; height ; width t`
|
|
84
|
+
*/
|
|
85
|
+
REPORT_CELL_SIZE_PIXELS = 16,
|
|
86
|
+
/**
|
|
87
|
+
* Report text area size in pixels.
|
|
88
|
+
* Response: `CSI 8 ; height ; width t`
|
|
89
|
+
*/
|
|
90
|
+
REPORT_TEXT_AREA_SIZE_PIXELS = 18,
|
|
91
|
+
/**
|
|
92
|
+
* Report icon label.
|
|
93
|
+
* Response: `OSC L label ST`
|
|
94
|
+
*/
|
|
95
|
+
REPORT_ICON_LABEL = 19,
|
|
96
|
+
/**
|
|
97
|
+
* Report window title.
|
|
98
|
+
* Response: `OSC l label ST`
|
|
99
|
+
*/
|
|
100
|
+
REPORT_WINDOW_TITLE = 21,
|
|
101
|
+
/**
|
|
102
|
+
* Push window title on stack.
|
|
103
|
+
*/
|
|
104
|
+
PUSH_WINDOW_TITLE = 22,
|
|
105
|
+
/**
|
|
106
|
+
* Pop window title from stack.
|
|
107
|
+
*/
|
|
108
|
+
POP_WINDOW_TITLE = 23,
|
|
109
|
+
/**
|
|
110
|
+
* Resize the screen to `[width, height]` in pixels and resize the text area to `[cols, lines]` in characters.
|
|
111
|
+
* (DECSLPP - Set Lines Per Page)
|
|
112
|
+
*/
|
|
113
|
+
RESIZE_SCREEN_AND_TEXT_AREA = 24,
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
116
|
+
* Generates an XTerm Window Operation (XTWINOPS) sequence.
|
|
117
|
+
*
|
|
118
|
+
* `CSI Ps ; Ps ; Ps t`
|
|
119
|
+
* @param p The primary parameter, typically one of {@link XTermWindowOp}.
|
|
120
|
+
* @param ps Additional parameters.
|
|
121
|
+
* @returns The ANSI sequence string, or an empty string if `p` is invalid.
|
|
122
|
+
* @see {@link https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps;Ps;Ps-t.1EB0}
|
|
123
|
+
*/
|
|
124
|
+
declare const xtermWindowOp: (p: number, ...ps: number[]) => string;
|
|
125
125
|
/**
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
* Alias for {@link xtermWindowOp}.
|
|
127
|
+
*/
|
|
128
|
+
declare const XTWINOPS: (p: number, ...ps: number[]) => string;
|
|
129
129
|
/**
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
130
|
+
* Resizes the terminal window's text area to a specified height and width in characters.
|
|
131
|
+
* This effectively sets the number of rows and columns for text display.
|
|
132
|
+
*
|
|
133
|
+
* Sequence: `CSI 4 ; height ; width t`
|
|
134
|
+
* @param height The desired height in characters (number of rows).
|
|
135
|
+
* @param width The desired width in characters (number of columns).
|
|
136
|
+
* @returns The ANSI escape sequence to resize the text area.
|
|
137
|
+
* @see xtermWindowOp
|
|
138
|
+
* @see XTermWindowOp.RESIZE_TEXT_AREA_CHARS
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* import { resizeTextAreaChars } from "@visulima/ansi";
|
|
142
|
+
*
|
|
143
|
+
* // Resize to 24 rows, 80 columns
|
|
144
|
+
* process.stdout.write(resizeTextAreaChars(24, 80));
|
|
145
|
+
* // Sends: "\x1b[4;24;80t"
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
declare const resizeTextAreaChars: (height: number, width: number) => string;
|
|
149
149
|
/**
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
150
|
+
* Requests a report of the terminal window's text area size in characters (rows and columns).
|
|
151
|
+
* The terminal is expected to respond with a sequence like `CSI 4 ; height ; width t`.
|
|
152
|
+
*
|
|
153
|
+
* This function uses `XTermWindowOp.REQUEST_WINDOW_SIZE_WIN_OP_COMPAT` (14), which corresponds to
|
|
154
|
+
* `XTermWindowOp.REPORT_TEXT_AREA_SIZE_CHARS` in XTerm.
|
|
155
|
+
*
|
|
156
|
+
* Sequence: `CSI 14 t` (which triggers the report `CSI 4 ; height ; width t`).
|
|
157
|
+
* @returns The ANSI escape sequence to request the text area size in characters.
|
|
158
|
+
* @see xtermWindowOp
|
|
159
|
+
* @see XTermWindowOp.REPORT_TEXT_AREA_SIZE_CHARS
|
|
160
|
+
* @see XTermWindowOp.REQUEST_WINDOW_SIZE_WIN_OP_COMPAT
|
|
161
|
+
* @example
|
|
162
|
+
* ```typescript
|
|
163
|
+
* import { requestTextAreaSizeChars } from "@visulima/ansi";
|
|
164
|
+
*
|
|
165
|
+
* process.stdout.write(requestTextAreaSizeChars());
|
|
166
|
+
* // Sends: "\x1b[14t"
|
|
167
|
+
* // Expect response like: "\x1b[4;24;80t" if terminal is 24x80
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
declare const requestTextAreaSizeChars: () => string;
|
|
171
171
|
/**
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
172
|
+
* Requests a report of the terminal's character cell size in pixels.
|
|
173
|
+
* The terminal is expected to respond with a sequence like `CSI 6 ; height ; width t`,
|
|
174
|
+
* where height and width are the dimensions of a single character cell in pixels.
|
|
175
|
+
*
|
|
176
|
+
* Sequence: `CSI 16 t` (which triggers the report `CSI 6 ; height ; width t`).
|
|
177
|
+
* @returns The ANSI escape sequence to request the cell size in pixels.
|
|
178
|
+
* @see xtermWindowOp
|
|
179
|
+
* @see XTermWindowOp.REPORT_CELL_SIZE_PIXELS
|
|
180
|
+
* @example
|
|
181
|
+
* ```typescript
|
|
182
|
+
* import { requestCellSizePixels } from "@visulima/ansi";
|
|
183
|
+
*
|
|
184
|
+
* process.stdout.write(requestCellSizePixels());
|
|
185
|
+
* // Sends: "\x1b[16t"
|
|
186
|
+
* // Expect response like: "\x1b[6;15;8t" if cell size is 15px height, 8px width
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
189
|
+
declare const requestCellSizePixels: () => string;
|
|
190
190
|
/**
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
191
|
+
* Requests a report of the terminal window's text area size in pixels.
|
|
192
|
+
* The terminal is expected to respond with a sequence like `CSI 8 ; height ; width t`.
|
|
193
|
+
*
|
|
194
|
+
* Sequence: `CSI 18 t` (which triggers the report `CSI 8 ; height ; width t`).
|
|
195
|
+
* @returns The ANSI escape sequence to request the text area size in pixels.
|
|
196
|
+
* @see xtermWindowOp
|
|
197
|
+
* @see XTermWindowOp.REPORT_TEXT_AREA_SIZE_PIXELS
|
|
198
|
+
* @example
|
|
199
|
+
* ```typescript
|
|
200
|
+
* import { requestTextAreaSizePixels } from "@visulima/ansi";
|
|
201
|
+
*
|
|
202
|
+
* process.stdout.write(requestTextAreaSizePixels());
|
|
203
|
+
* // Sends: "\x1b[18t"
|
|
204
|
+
* // Expect response like: "\x1b[8;600;800t" if text area is 600px height, 800px width
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
207
|
+
declare const requestTextAreaSizePixels: () => string;
|
|
208
208
|
/**
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
209
|
+
* De-iconifies the terminal window (restores it if minimized).
|
|
210
|
+
*
|
|
211
|
+
* Sequence: `CSI 1 t`
|
|
212
|
+
* @returns The ANSI escape sequence to de-iconify the window.
|
|
213
|
+
* @see xtermWindowOp
|
|
214
|
+
* @see XTermWindowOp.DEICONIFY_WINDOW
|
|
215
|
+
* @example
|
|
216
|
+
* ```typescript
|
|
217
|
+
* import { deiconifyWindow } from "@visulima/ansi";
|
|
218
|
+
*
|
|
219
|
+
* process.stdout.write(deiconifyWindow()); // Sends: "\x1b[1t"
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
declare const deiconifyWindow: () => string;
|
|
223
223
|
/**
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
224
|
+
* Iconifies the terminal window (minimizes it).
|
|
225
|
+
*
|
|
226
|
+
* Sequence: `CSI 2 t`
|
|
227
|
+
* @returns The ANSI escape sequence to iconify the window.
|
|
228
|
+
* @see xtermWindowOp
|
|
229
|
+
* @see XTermWindowOp.ICONIFY_WINDOW
|
|
230
|
+
* @example
|
|
231
|
+
* ```typescript
|
|
232
|
+
* import { iconifyWindow } from "@visulima/ansi";
|
|
233
|
+
*
|
|
234
|
+
* process.stdout.write(iconifyWindow()); // Sends: "\x1b[2t"
|
|
235
|
+
* ```
|
|
236
|
+
*/
|
|
237
|
+
declare const iconifyWindow: () => string;
|
|
238
238
|
/**
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
239
|
+
* Moves the terminal window to the specified screen coordinates (top-left corner).
|
|
240
|
+
*
|
|
241
|
+
* Sequence: `CSI 3 ; x ; y t`
|
|
242
|
+
* - `x`: The X-coordinate (horizontal position in pixels from the left edge).
|
|
243
|
+
* - `y`: The Y-coordinate (vertical position in pixels from the top edge).
|
|
244
|
+
* @param x The target X-coordinate for the window's top-left corner.
|
|
245
|
+
* @param y The target Y-coordinate for the window's top-left corner.
|
|
246
|
+
* @returns The ANSI escape sequence to move the window.
|
|
247
|
+
* @see xtermWindowOp
|
|
248
|
+
* @see XTermWindowOp.MOVE_WINDOW
|
|
249
|
+
* @example
|
|
250
|
+
* ```typescript
|
|
251
|
+
* import { moveWindow } from "@visulima/ansi";
|
|
252
|
+
*
|
|
253
|
+
* // Move window to X=100, Y=50
|
|
254
|
+
* process.stdout.write(moveWindow(100, 50)); // Sends: "\x1b[3;100;50t"
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
declare const moveWindow: (x: number, y: number) => string;
|
|
258
258
|
/**
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
259
|
+
* Raises the terminal window to the front of the stacking order.
|
|
260
|
+
*
|
|
261
|
+
* Sequence: `CSI 5 t`
|
|
262
|
+
* @returns The ANSI escape sequence to raise the window.
|
|
263
|
+
* @see xtermWindowOp
|
|
264
|
+
* @see XTermWindowOp.RAISE_WINDOW
|
|
265
|
+
* @example
|
|
266
|
+
* ```typescript
|
|
267
|
+
* import { raiseWindow } from "@visulima/ansi";
|
|
268
|
+
*
|
|
269
|
+
* process.stdout.write(raiseWindow()); // Sends: "\x1b[5t"
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
declare const raiseWindow: () => string;
|
|
273
273
|
/**
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
274
|
+
* Lowers the terminal window to the bottom of the stacking order.
|
|
275
|
+
*
|
|
276
|
+
* Sequence: `CSI 6 t`
|
|
277
|
+
* @returns The ANSI escape sequence to lower the window.
|
|
278
|
+
* @see xtermWindowOp
|
|
279
|
+
* @see XTermWindowOp.LOWER_WINDOW
|
|
280
|
+
* @example
|
|
281
|
+
* ```typescript
|
|
282
|
+
* import { lowerWindow } from "@visulima/ansi";
|
|
283
|
+
*
|
|
284
|
+
* process.stdout.write(lowerWindow()); // Sends: "\x1b[6t"
|
|
285
|
+
* ```
|
|
286
|
+
*/
|
|
287
|
+
declare const lowerWindow: () => string;
|
|
288
288
|
/**
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
289
|
+
* Refreshes the terminal window content.
|
|
290
|
+
* This can be useful if the display becomes corrupted or needs redrawing.
|
|
291
|
+
*
|
|
292
|
+
* Sequence: `CSI 7 t`
|
|
293
|
+
* @returns The ANSI escape sequence to refresh the window.
|
|
294
|
+
* @see xtermWindowOp
|
|
295
|
+
* @see XTermWindowOp.REFRESH_WINDOW
|
|
296
|
+
* @example
|
|
297
|
+
* ```typescript
|
|
298
|
+
* import { refreshWindow } from "@visulima/ansi";
|
|
299
|
+
*
|
|
300
|
+
* process.stdout.write(refreshWindow()); // Sends: "\x1b[7t"
|
|
301
|
+
* ```
|
|
302
|
+
*/
|
|
303
|
+
declare const refreshWindow: () => string;
|
|
304
304
|
/**
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
305
|
+
* Resizes the terminal window's text area to a specified height and width in pixels.
|
|
306
|
+
*
|
|
307
|
+
* Sequence: `CSI 8 ; height ; width t`
|
|
308
|
+
* @param height The desired height in pixels.
|
|
309
|
+
* @param width The desired width in pixels.
|
|
310
|
+
* @returns The ANSI escape sequence to resize the text area in pixels.
|
|
311
|
+
* @see xtermWindowOp
|
|
312
|
+
* @see XTermWindowOp.RESIZE_TEXT_AREA_PIXELS
|
|
313
|
+
* @example
|
|
314
|
+
* ```typescript
|
|
315
|
+
* import { resizeTextAreaPixels } from "@visulima/ansi";
|
|
316
|
+
*
|
|
317
|
+
* // Resize text area to 600px height, 800px width
|
|
318
|
+
* process.stdout.write(resizeTextAreaPixels(600, 800));
|
|
319
|
+
* // Sends: "\x1b[8;600;800t"
|
|
320
|
+
* ```
|
|
321
|
+
*/
|
|
322
|
+
declare const resizeTextAreaPixels: (height: number, width: number) => string;
|
|
323
323
|
/**
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
324
|
+
* Restores a maximized terminal window to its previous size and position.
|
|
325
|
+
* XTerm typically uses `CSI 9 ; 0 t` for this operation, where 0 signifies restore.
|
|
326
|
+
* Some interpretations might use `CSI 9 t` if no other parameter implies restore.
|
|
327
|
+
*
|
|
328
|
+
* Sequence: `CSI 9 t` (simplified, relies on `XTermWindowOp.RESTORE_MAXIMIZED_WINDOW` which is 9)
|
|
329
|
+
* More specific might be `CSI 9 ; 0 t`.
|
|
330
|
+
* @returns The ANSI escape sequence to restore a maximized window.
|
|
331
|
+
* @see xtermWindowOp
|
|
332
|
+
* @see XTermWindowOp.RESTORE_MAXIMIZED_WINDOW
|
|
333
|
+
* @example
|
|
334
|
+
* ```typescript
|
|
335
|
+
* import { restoreMaximizedWindow } from "@visulima/ansi";
|
|
336
|
+
*
|
|
337
|
+
* process.stdout.write(restoreMaximizedWindow()); // Sends: "\x1b[9t"
|
|
338
|
+
* ```
|
|
339
|
+
*/
|
|
340
|
+
declare const restoreMaximizedWindow: () => string;
|
|
341
341
|
/**
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
342
|
+
* Maximizes the terminal window (often a "zoom" or toggle effect).
|
|
343
|
+
* XTerm typically uses `CSI 9 ; 1 t` for this, where 1 signifies maximize.
|
|
344
|
+
* Some terminals might use `CSI 10 t` for a general maximize/toggle.
|
|
345
|
+
* This function uses `XTermWindowOp.MAXIMIZE_WINDOW` which is 10.
|
|
346
|
+
*
|
|
347
|
+
* Sequence: `CSI 10 t` (using `XTermWindowOp.MAXIMIZE_WINDOW`).
|
|
348
|
+
* @returns The ANSI escape sequence to maximize the window.
|
|
349
|
+
* @see xtermWindowOp
|
|
350
|
+
* @see XTermWindowOp.MAXIMIZE_WINDOW
|
|
351
|
+
* @example
|
|
352
|
+
* ```typescript
|
|
353
|
+
* import { maximizeWindow } from "@visulima/ansi";
|
|
354
|
+
*
|
|
355
|
+
* process.stdout.write(maximizeWindow()); // Sends: "\x1b[10t"
|
|
356
|
+
* ```
|
|
357
|
+
*/
|
|
358
|
+
declare const maximizeWindow: () => string;
|
|
359
359
|
/**
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
360
|
+
* Report window position.
|
|
361
|
+
* Response: `CSI 3 ; x ; y t`
|
|
362
|
+
* `CSI 1 3 t`
|
|
363
|
+
*
|
|
364
|
+
* Requests a report of the terminal window's position on the screen.
|
|
365
|
+
* The terminal responds with `CSI 3 ; x ; y t` where x and y are the window coordinates.
|
|
366
|
+
* @returns The ANSI escape sequence to request window position.
|
|
367
|
+
* @see xtermWindowOp
|
|
368
|
+
* @see XTermWindowOp.REPORT_WINDOW_POSITION
|
|
369
|
+
* @example
|
|
370
|
+
* ```typescript
|
|
371
|
+
* import { reportWindowPosition } from "@visulima/ansi";
|
|
372
|
+
*
|
|
373
|
+
* process.stdout.write(reportWindowPosition());
|
|
374
|
+
* // Sends: "\x1b[13t"
|
|
375
|
+
* // Expect response like: "\x1b[3;100;50t" if window is at position (100, 50)
|
|
376
|
+
* ```
|
|
377
|
+
*/
|
|
378
|
+
declare const reportWindowPosition: () => string;
|
|
379
379
|
/**
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
380
|
+
* Report window state.
|
|
381
|
+
* Response: `CSI 1 t` if de-iconified, `CSI 2 t` if iconified.
|
|
382
|
+
* (XTerm doc uses `CSI ? 1 t` and `CSI ? 2 t`, but general form `CSI Ps t` is also listed for 11)
|
|
383
|
+
* `CSI 1 1 t`
|
|
384
|
+
*
|
|
385
|
+
* Requests a report of the terminal window's state (iconified/minimized or de-iconified/normal).
|
|
386
|
+
* The terminal responds with `CSI 1 t` if de-iconified or `CSI 2 t` if iconified.
|
|
387
|
+
* @returns The ANSI escape sequence to request window state.
|
|
388
|
+
* @see xtermWindowOp
|
|
389
|
+
* @see XTermWindowOp.REPORT_WINDOW_STATE
|
|
390
|
+
* @example
|
|
391
|
+
* ```typescript
|
|
392
|
+
* import { reportWindowState } from "@visulima/ansi";
|
|
393
|
+
*
|
|
394
|
+
* process.stdout.write(reportWindowState());
|
|
395
|
+
* // Sends: "\x1b[11t"
|
|
396
|
+
* // Expect response: "\x1b[1t" (de-iconified) or "\x1b[2t" (iconified)
|
|
397
|
+
* ```
|
|
398
|
+
*/
|
|
399
|
+
declare const reportWindowState: () => string;
|
|
400
400
|
/**
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
401
|
+
* Set page size (DECSLPP - Set Lines Per Page), often used for resizing the screen.
|
|
402
|
+
* `CSI Pl t` where Pl is the number of lines.
|
|
403
|
+
* XTerm extends this to `CSI > lines ; width ; height t` where width/height are in pixels.
|
|
404
|
+
* `CSI 24 ; lines t`
|
|
405
|
+
* @param lines The number of lines for the page.
|
|
406
|
+
* @returns The ANSI escape sequence to set page size.
|
|
407
|
+
* @see xtermWindowOp
|
|
408
|
+
* @see XTermWindowOp.RESIZE_SCREEN_AND_TEXT_AREA
|
|
409
|
+
* @example
|
|
410
|
+
* ```typescript
|
|
411
|
+
* import { setPageSizeLines } from "@visulima/ansi";
|
|
412
|
+
*
|
|
413
|
+
* // Set page size to 30 lines
|
|
414
|
+
* process.stdout.write(setPageSizeLines(30));
|
|
415
|
+
* // Sends: "\x1b[24;30t"
|
|
416
|
+
* ```
|
|
417
|
+
*/
|
|
418
|
+
declare const setPageSizeLines: (lines: number) => string;
|
|
419
|
+
export { XTWINOPS, XTermWindowOp, deiconifyWindow, iconifyWindow, lowerWindow, maximizeWindow, moveWindow, raiseWindow, refreshWindow, reportWindowPosition, reportWindowState, requestCellSizePixels, requestTextAreaSizeChars, requestTextAreaSizePixels, resizeTextAreaChars, resizeTextAreaPixels, restoreMaximizedWindow, setPageSizeLines, xtermWindowOp };
|