@visulima/ansi 4.0.0-alpha.8 → 4.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.
Files changed (85) hide show
  1. package/CHANGELOG.md +306 -0
  2. package/LICENSE.md +0 -20
  3. package/README.md +41 -10
  4. package/dist/alternative-screen.d.ts +71 -70
  5. package/dist/alternative-screen.js +1 -8
  6. package/dist/background.d.ts +72 -0
  7. package/dist/background.js +1 -0
  8. package/dist/charset.d.ts +52 -0
  9. package/dist/charset.js +1 -0
  10. package/dist/clear.d.ts +74 -73
  11. package/dist/clear.js +1 -10
  12. package/dist/clipboard.d.ts +76 -0
  13. package/dist/clipboard.js +1 -0
  14. package/dist/constants.d.ts +18 -10
  15. package/dist/constants.js +1 -0
  16. package/dist/cursor.d.ts +421 -406
  17. package/dist/cursor.js +1 -3
  18. package/dist/cwd.d.ts +26 -0
  19. package/dist/cwd.js +1 -0
  20. package/dist/erase.d.ts +193 -192
  21. package/dist/erase.js +1 -47
  22. package/dist/finalterm.d.ts +47 -0
  23. package/dist/finalterm.js +1 -0
  24. package/dist/focus.d.ts +20 -0
  25. package/dist/focus.js +1 -0
  26. package/dist/hyperlink.d.ts +25 -25
  27. package/dist/hyperlink.js +1 -5
  28. package/dist/image.d.ts +70 -70
  29. package/dist/image.js +1 -40
  30. package/dist/index.d.ts +38 -35
  31. package/dist/index.js +1 -26
  32. package/dist/iterm2.d.ts +285 -58
  33. package/dist/iterm2.js +1 -12
  34. package/dist/keypad.d.ts +27 -0
  35. package/dist/keypad.js +1 -0
  36. package/dist/kitty-graphics.d.ts +17 -0
  37. package/dist/kitty-graphics.js +1 -0
  38. package/dist/mode.d.ts +585 -584
  39. package/dist/mode.js +1 -245
  40. package/dist/mouse.d.ts +227 -226
  41. package/dist/mouse.js +1 -106
  42. package/dist/notification.d.ts +30 -0
  43. package/dist/notification.js +1 -0
  44. package/dist/packem_shared/IT2_AUTO-K3GubKy7.js +1 -0
  45. package/dist/packem_shared/ITerm2File-BkLc5ipB.js +1 -0
  46. package/dist/packem_shared/cursor-BXG1O_IE.js +1 -0
  47. package/dist/packem_shared/restoreCursor-CyaXIMQf.js +2 -0
  48. package/dist/passthrough.d.ts +74 -73
  49. package/dist/passthrough.js +1 -29
  50. package/dist/paste.d.ts +23 -0
  51. package/dist/paste.js +1 -0
  52. package/dist/progress.d.ts +37 -36
  53. package/dist/progress.js +1 -0
  54. package/dist/reset.d.ts +25 -24
  55. package/dist/reset.js +1 -4
  56. package/dist/screen.d.ts +226 -225
  57. package/dist/screen.js +1 -27
  58. package/dist/scroll.d.ts +64 -63
  59. package/dist/scroll.js +1 -18
  60. package/dist/sixel.d.ts +19 -0
  61. package/dist/sixel.js +1 -0
  62. package/dist/status.d.ts +521 -520
  63. package/dist/status.js +1 -95
  64. package/dist/strip.d.ts +26 -1
  65. package/dist/strip.js +1 -13
  66. package/dist/termcap.d.ts +36 -35
  67. package/dist/termcap.js +1 -25
  68. package/dist/title.d.ts +176 -175
  69. package/dist/title.js +1 -19
  70. package/dist/urxvt.d.ts +15 -0
  71. package/dist/urxvt.js +1 -0
  72. package/dist/window-ops.d.ts +399 -398
  73. package/dist/window-ops.js +1 -61
  74. package/dist/xterm.d.ts +167 -84
  75. package/dist/xterm.js +1 -33
  76. package/package.json +60 -9
  77. package/dist/helpers.d.ts +0 -14
  78. package/dist/iterm2/iterm2-properties.d.ts +0 -135
  79. package/dist/iterm2/iterm2-sequences.d.ts +0 -96
  80. package/dist/packem_shared/IT2_AUTO-DyYWsxno.js +0 -6
  81. package/dist/packem_shared/ITerm2File-CUZDBk99.js +0 -137
  82. package/dist/packem_shared/constants-CE7WkXh_.js +0 -9
  83. package/dist/packem_shared/cursor-ChpV7cgs.js +0 -72
  84. package/dist/packem_shared/resetProgressBar-D9r2s7eV.js +0 -18
  85. package/dist/packem_shared/restoreCursor-GfYEeJqN.js +0 -323
@@ -1,77 +1,78 @@
1
1
  /**
2
- * Default value for the `limit` parameter in {@link screenPassthrough}, indicating no chunking.
3
- * When this value is used (or any value <= 0), the passthrough sequence is not split into smaller chunks.
4
- */
5
- export declare const SCREEN_MAX_LEN_DEFAULT: number;
2
+ * Default value for the `limit` parameter in {@link screenPassthrough}, indicating no chunking.
3
+ * When this value is used (or any value <= 0), the passthrough sequence is not split into smaller chunks.
4
+ */
5
+ declare const SCREEN_MAX_LEN_DEFAULT: number;
6
6
  /**
7
- * A typical limit for string sequences in GNU Screen (e.g., 768 bytes).
8
- * This constant can be used as a practical value for the `limit` parameter in {@link screenPassthrough}
9
- * to avoid issues with Screen's internal buffers, though the function itself defaults to no limit.
10
- * It's provided for informational purposes and as a suggested practical chunking limit.
11
- */
12
- export declare const SCREEN_TYPICAL_LIMIT: number;
7
+ * A typical limit for string sequences in GNU Screen (e.g., 768 bytes).
8
+ * This constant can be used as a practical value for the `limit` parameter in {@link screenPassthrough}
9
+ * to avoid issues with Screen's internal buffers, though the function itself defaults to no limit.
10
+ * It's provided for informational purposes and as a suggested practical chunking limit.
11
+ */
12
+ declare const SCREEN_TYPICAL_LIMIT: number;
13
13
  /**
14
- * Wraps a given ANSI escape sequence in a DCS (Device Control String) passthrough sequence
15
- * specifically for GNU Screen. This allows raw escape sequences to be sent to the
16
- * terminal emulator that is hosting Screen, bypassing Screen's own interpretation.
17
- *
18
- * The basic format is: `DCS <data> ST` (where `DCS` is `ESC P` and `ST` is `ESC \`).
19
- *
20
- * GNU Screen has limitations on the length of string sequences it can handle (often around 768 bytes).
21
- * This function can optionally chunk the input `sequence` into smaller parts, each wrapped
22
- * in its own `DCS...ST` sequence, to work around this limitation.
23
- * @param sequence The ANSI escape sequence string to be wrapped.
24
- * @param limit The maximum length for each chunk of the `sequence` before it's wrapped.
25
- * If `0` or a negative number, the sequence is not chunked. Defaults to {@link SCREEN_MAX_LEN_DEFAULT} (0).
26
- * Consider using {@link SCREEN_TYPICAL_LIMIT} (768) for practical chunking with Screen.
27
- * @returns The wrapped string, possibly chunked into multiple `DCS...ST` sequences if `limit` is positive and the `sequence` exceeds it.
28
- * @see {@link https://www.gnu.org/software/screen/manual/screen.html#String-Escapes} GNU Screen Manual - String Escapes.
29
- * @example
30
- * ```typescript
31
- * import { screenPassthrough, SCREEN_TYPICAL_LIMIT } from \'@visulima/ansi/passthrough\';
32
- * import { cursorShow, cursorHide } from \'@visulima/ansi/cursor\';
33
- *
34
- * const longSequence = cursorHide + "Some very long output..." + cursorShow;
35
- *
36
- * // No chunking (default behavior if sequence is short enough or limit is 0)
37
- * const passthrough1 = screenPassthrough(cursorHide);
38
- * console.log(JSON.stringify(passthrough1)); // "\u001bP?25l\u001b\\"
39
- *
40
- * // With chunking, assuming SCREEN_TYPICAL_LIMIT is small for demonstration
41
- * const limitedPassthrough = screenPassthrough(longSequence, 10); // Hypothetical small limit
42
- * // Example output if longSequence was "0123456789abcde" and limit 10:
43
- * // "\u001bP0123456789\u001b\\\u001bPabcde\u001b\\"
44
- * console.log(JSON.stringify(limitedPassthrough));
45
- * ```
46
- */
47
- export declare const screenPassthrough: (sequence: string, limit?: number) => string;
14
+ * Wraps a given ANSI escape sequence in a DCS (Device Control String) passthrough sequence
15
+ * specifically for GNU Screen. This allows raw escape sequences to be sent to the
16
+ * terminal emulator that is hosting Screen, bypassing Screen's own interpretation.
17
+ *
18
+ * The basic format is: `DCS <data> ST` (where `DCS` is `ESC P` and `ST` is `ESC \`).
19
+ *
20
+ * GNU Screen has limitations on the length of string sequences it can handle (often around 768 bytes).
21
+ * This function can optionally chunk the input `sequence` into smaller parts, each wrapped
22
+ * in its own `DCS...ST` sequence, to work around this limitation.
23
+ * @param sequence The ANSI escape sequence string to be wrapped.
24
+ * @param limit The maximum length for each chunk of the `sequence` before it's wrapped.
25
+ * If `0` or a negative number, the sequence is not chunked. Defaults to {@link SCREEN_MAX_LEN_DEFAULT} (0).
26
+ * Consider using {@link SCREEN_TYPICAL_LIMIT} (768) for practical chunking with Screen.
27
+ * @returns The wrapped string, possibly chunked into multiple `DCS...ST` sequences if `limit` is positive and the `sequence` exceeds it.
28
+ * @see {@link https://www.gnu.org/software/screen/manual/screen.html#String-Escapes} GNU Screen Manual - String Escapes.
29
+ * @example
30
+ * ```typescript
31
+ * import { screenPassthrough, SCREEN_TYPICAL_LIMIT } from \'@visulima/ansi/passthrough\';
32
+ * import { cursorShow, cursorHide } from \'@visulima/ansi/cursor\';
33
+ *
34
+ * const longSequence = cursorHide + "Some very long output..." + cursorShow;
35
+ *
36
+ * // No chunking (default behavior if sequence is short enough or limit is 0)
37
+ * const passthrough1 = screenPassthrough(cursorHide);
38
+ * console.log(JSON.stringify(passthrough1)); // "\u001bP?25l\u001b\\"
39
+ *
40
+ * // With chunking, assuming SCREEN_TYPICAL_LIMIT is small for demonstration
41
+ * const limitedPassthrough = screenPassthrough(longSequence, 10); // Hypothetical small limit
42
+ * // Example output if longSequence was "0123456789abcde" and limit 10:
43
+ * // "\u001bP0123456789\u001b\\\u001bPabcde\u001b\\"
44
+ * console.log(JSON.stringify(limitedPassthrough));
45
+ * ```
46
+ */
47
+ declare const screenPassthrough: (sequence: string, limit?: number) => string;
48
48
  /**
49
- * Wraps a given ANSI escape sequence in a special DCS (Device Control String) passthrough sequence
50
- * designed for tmux (Terminal Multiplexer). This allows raw escape sequences to be sent to the
51
- * terminal emulator hosting tmux, bypassing tmux's own interpretation.
52
- *
53
- * The format is: `DCS tmux ; <escaped-data> ST`
54
- * (where `DCS` is `ESC P`, and `ST` is `ESC \`).
55
- *
56
- * The `<escaped-data>` is the original `sequence` with all occurrences of the ESC character (`\u001B`)
57
- * doubled (i.e., `ESC` becomes `ESC ESC`).
58
- *
59
- * **Note:** For this to work, the tmux option `allow-passthrough` must be enabled (`on`) in the tmux configuration.
60
- * By default, it might be off.
61
- * @param sequence The ANSI escape sequence string to be wrapped and properly escaped for tmux.
62
- * @returns The wrapped and escaped string suitable for tmux passthrough.
63
- * @see {@link https://github.com/tmux/tmux/wiki/FAQ#what-is-the-passthrough-escape-sequence-and-how-do-i-use-it} Tmux FAQ on Passthrough.
64
- * @example
65
- * ```typescript
66
- * import { tmuxPassthrough } from \'@visulima/ansi/passthrough\';
67
- * import { cursorShow } from \'@visulima/ansi/cursor\';
68
- *
69
- * const originalSequence = cursorShow; // e.g., "\u001b[?25h"
70
- * const passthrough = tmuxPassthrough(originalSequence);
71
- *
72
- * // Expected: "\u001bPtmux;\u001b\u001b[?25h\u001b\\"
73
- * // (ESC P tmux ; ESC ESC [ ? 2 5 h ESC \)
74
- * console.log(JSON.stringify(passthrough));
75
- * ```
76
- */
77
- export declare const tmuxPassthrough: (sequence: string) => string;
49
+ * Wraps a given ANSI escape sequence in a special DCS (Device Control String) passthrough sequence
50
+ * designed for tmux (Terminal Multiplexer). This allows raw escape sequences to be sent to the
51
+ * terminal emulator hosting tmux, bypassing tmux's own interpretation.
52
+ *
53
+ * The format is: `DCS tmux ; <escaped-data> ST`
54
+ * (where `DCS` is `ESC P`, and `ST` is `ESC \`).
55
+ *
56
+ * The `<escaped-data>` is the original `sequence` with all occurrences of the ESC character (`\u001B`)
57
+ * doubled (i.e., `ESC` becomes `ESC ESC`).
58
+ *
59
+ * **Note:** For this to work, the tmux option `allow-passthrough` must be enabled (`on`) in the tmux configuration.
60
+ * By default, it might be off.
61
+ * @param sequence The ANSI escape sequence string to be wrapped and properly escaped for tmux.
62
+ * @returns The wrapped and escaped string suitable for tmux passthrough.
63
+ * @see {@link https://github.com/tmux/tmux/wiki/FAQ#what-is-the-passthrough-escape-sequence-and-how-do-i-use-it} Tmux FAQ on Passthrough.
64
+ * @example
65
+ * ```typescript
66
+ * import { tmuxPassthrough } from \'@visulima/ansi/passthrough\';
67
+ * import { cursorShow } from \'@visulima/ansi/cursor\';
68
+ *
69
+ * const originalSequence = cursorShow; // e.g., "\u001b[?25h"
70
+ * const passthrough = tmuxPassthrough(originalSequence);
71
+ *
72
+ * // Expected: "\u001bPtmux;\u001b\u001b[?25h\u001b\\"
73
+ * // (ESC P tmux ; ESC ESC [ ? 2 5 h ESC \)
74
+ * console.log(JSON.stringify(passthrough));
75
+ * ```
76
+ */
77
+ declare const tmuxPassthrough: (sequence: string) => string;
78
+ export { SCREEN_MAX_LEN_DEFAULT, SCREEN_TYPICAL_LIMIT, screenPassthrough, tmuxPassthrough };
@@ -1,29 +1 @@
1
- import { a as ST, D as DCS, E as ESC } from './packem_shared/constants-CE7WkXh_.js';
2
-
3
- const SCREEN_MAX_LEN_DEFAULT = 0;
4
- const SCREEN_TYPICAL_LIMIT = 768;
5
- const screenPassthrough = (sequence, limit = SCREEN_MAX_LEN_DEFAULT) => {
6
- let result = DCS;
7
- if (limit > 0 && sequence.length > limit) {
8
- for (let index = 0; index < sequence.length; index += limit) {
9
- const end = Math.min(index + limit, sequence.length);
10
- result += sequence.slice(index, end);
11
- if (end < sequence.length) {
12
- result += ST + DCS;
13
- }
14
- }
15
- } else {
16
- result += sequence;
17
- }
18
- result += ST;
19
- return result;
20
- };
21
- const tmuxPassthrough = (sequence) => {
22
- let escapedSequence = "";
23
- for (const element of sequence) {
24
- escapedSequence += element === ESC ? ESC + ESC : element;
25
- }
26
- return `${DCS}tmux;${escapedSequence}${ST}`;
27
- };
28
-
29
- export { SCREEN_MAX_LEN_DEFAULT, SCREEN_TYPICAL_LIMIT, screenPassthrough, tmuxPassthrough };
1
+ import{ST as r,DCS as s,ESC as h}from"./constants.js";const E=0,g=768,u=(e,t=E)=>{let n=s;if(t>0&&e.length>t)for(let l=0;l<e.length;l+=t){const o=Math.min(l+t,e.length);n+=e.slice(l,o),o<e.length&&(n+=r+s)}else n+=e;return n+=r,n},m=e=>{const t=e.replaceAll(h,h+h);return`${s}tmux;${t}${r}`};export{E as SCREEN_MAX_LEN_DEFAULT,g as SCREEN_TYPICAL_LIMIT,u as screenPassthrough,m as tmuxPassthrough};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Marker a terminal emits immediately before pasted text when bracketed paste
3
+ * mode is enabled.
4
+ *
5
+ * Sequence: `CSI 200 ~`
6
+ * @see {@link https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Bracketed-Paste-Mode}
7
+ */
8
+ declare const bracketedPasteStart: string;
9
+ /**
10
+ * Marker a terminal emits immediately after pasted text when bracketed paste
11
+ * mode is enabled.
12
+ *
13
+ * Sequence: `CSI 201 ~`
14
+ */
15
+ declare const bracketedPasteEnd: string;
16
+ /**
17
+ * Wraps `text` in the bracketed-paste start/end markers, mirroring how a
18
+ * terminal delivers pasted content to an application.
19
+ * @param text The text to wrap.
20
+ * @returns `text` surrounded by {@link bracketedPasteStart} and {@link bracketedPasteEnd}.
21
+ */
22
+ declare const wrapBracketedPaste: (text: string) => string;
23
+ export { bracketedPasteEnd, bracketedPasteStart, wrapBracketedPaste };
package/dist/paste.js ADDED
@@ -0,0 +1 @@
1
+ import{CSI as t}from"./constants.js";const a=`${t}200~`,r=`${t}201~`,c=e=>`${a}${e}${r}`;export{r as bracketedPasteEnd,a as bracketedPasteStart,c as wrapBracketedPaste};
@@ -1,41 +1,42 @@
1
1
  /**
2
- * Resets the progress bar to its default state (hidden).
3
- *
4
- * Sequence: `OSC 9 ; 4 ; 0 BEL`
5
- * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences}
6
- */
7
- export declare const resetProgressBar: string;
2
+ * Resets the progress bar to its default state (hidden).
3
+ *
4
+ * Sequence: `OSC 9 ; 4 ; 0 BEL`
5
+ * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences}
6
+ */
7
+ declare const resetProgressBar: string;
8
8
  /**
9
- * Returns a sequence for setting the progress bar to a specific percentage (0-100) in the "default" state.
10
- *
11
- * Sequence: `OSC 9 ; 4 ; 1 ; Percentage BEL`
12
- * @param percentage The progress percentage (0-100, clamped automatically)
13
- * @returns The progress bar sequence
14
- * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences}
15
- */
16
- export declare const setProgressBar: (percentage: number) => string;
9
+ * Returns a sequence for setting the progress bar to a specific percentage (0-100) in the "default" state.
10
+ *
11
+ * Sequence: `OSC 9 ; 4 ; 1 ; Percentage BEL`
12
+ * @param percentage The progress percentage (0-100, clamped automatically)
13
+ * @returns The progress bar sequence
14
+ * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences}
15
+ */
16
+ declare const setProgressBar: (percentage: number) => string;
17
17
  /**
18
- * Returns a sequence for setting the progress bar to a specific percentage (0-100) in the "Error" state.
19
- *
20
- * Sequence: `OSC 9 ; 4 ; 2 ; Percentage BEL`
21
- * @param percentage The progress percentage (0-100, clamped automatically)
22
- * @returns The error progress bar sequence
23
- * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences}
24
- */
25
- export declare const setErrorProgressBar: (percentage: number) => string;
18
+ * Returns a sequence for setting the progress bar to a specific percentage (0-100) in the "Error" state.
19
+ *
20
+ * Sequence: `OSC 9 ; 4 ; 2 ; Percentage BEL`
21
+ * @param percentage The progress percentage (0-100, clamped automatically)
22
+ * @returns The error progress bar sequence
23
+ * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences}
24
+ */
25
+ declare const setErrorProgressBar: (percentage: number) => string;
26
26
  /**
27
- * Sets the progress bar to the indeterminate state.
28
- *
29
- * Sequence: `OSC 9 ; 4 ; 3 BEL`
30
- * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences}
31
- */
32
- export declare const setIndeterminateProgressBar: string;
27
+ * Sets the progress bar to the indeterminate state.
28
+ *
29
+ * Sequence: `OSC 9 ; 4 ; 3 BEL`
30
+ * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences}
31
+ */
32
+ declare const setIndeterminateProgressBar: string;
33
33
  /**
34
- * Returns a sequence for setting the progress bar to a specific percentage (0-100) in the "Warning" state.
35
- *
36
- * Sequence: `OSC 9 ; 4 ; 4 ; Percentage BEL`
37
- * @param percentage The progress percentage (0-100, clamped automatically)
38
- * @returns The warning progress bar sequence
39
- * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences}
40
- */
41
- export declare const setWarningProgressBar: (percentage: number) => string;
34
+ * Returns a sequence for setting the progress bar to a specific percentage (0-100) in the "Warning" state.
35
+ *
36
+ * Sequence: `OSC 9 ; 4 ; 4 ; Percentage BEL`
37
+ * @param percentage The progress percentage (0-100, clamped automatically)
38
+ * @returns The warning progress bar sequence
39
+ * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences}
40
+ */
41
+ declare const setWarningProgressBar: (percentage: number) => string;
42
+ export { resetProgressBar, setErrorProgressBar, setIndeterminateProgressBar, setProgressBar, setWarningProgressBar };
@@ -0,0 +1 @@
1
+ import{OSC as s,BEL as e}from"./constants.js";const a=`${s}9;4;0${e}`,o=r=>{const t=Math.min(Math.max(0,r),100);return`${s}9;4;1;${String(t)}${e}`},$=r=>{const t=Math.min(Math.max(0,r),100);return`${s}9;4;2;${String(t)}${e}`},g=`${s}9;4;3${e}`,i=r=>{const t=Math.min(Math.max(0,r),100);return`${s}9;4;4;${String(t)}${e}`};export{a as resetProgressBar,$ as setErrorProgressBar,g as setIndeterminateProgressBar,o as setProgressBar,i as setWarningProgressBar};
package/dist/reset.d.ts CHANGED
@@ -1,26 +1,27 @@
1
1
  /**
2
- * The ANSI escape sequence for Reset Initial State (RIS).
3
- * This command attempts to reset the terminal to its power-up state or initial configuration.
4
- * The exact behavior can vary between terminal emulators, but it typically includes:
5
- * - Resetting graphic rendition (SGR parameters) to default.
6
- * - Clearing the screen.
7
- * - Moving the cursor to the top-left (home position).
8
- * - Resetting character sets.
9
- * - Resetting tab stops.
10
- * - Resetting modes (like DECAWM, DECOM) to their defaults.
11
- *
12
- * Sequence: `ESC c`
13
- *
14
- * This is a more comprehensive reset than `CSI 0 m` (which only resets SGR) or `CSI 2 J` (which only clears the screen).
15
- * It is often referred to as a "hard reset".
16
- * @see {@link https://vt100.net/docs/vt510-rm/RIS.html VT510 RIS Documentation}
17
- * @see {@link https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Reset} Xterm Control Sequences - Reset
18
- */
19
- export declare const RESET_INITIAL_STATE: string;
2
+ * The ANSI escape sequence for Reset Initial State (RIS).
3
+ * This command attempts to reset the terminal to its power-up state or initial configuration.
4
+ * The exact behavior can vary between terminal emulators, but it typically includes:
5
+ * - Resetting graphic rendition (SGR parameters) to default.
6
+ * - Clearing the screen.
7
+ * - Moving the cursor to the top-left (home position).
8
+ * - Resetting character sets.
9
+ * - Resetting tab stops.
10
+ * - Resetting modes (like DECAWM, DECOM) to their defaults.
11
+ *
12
+ * Sequence: `ESC c`
13
+ *
14
+ * This is a more comprehensive reset than `CSI 0 m` (which only resets SGR) or `CSI 2 J` (which only clears the screen).
15
+ * It is often referred to as a "hard reset".
16
+ * @see {@link https://vt100.net/docs/vt510-rm/RIS.html VT510 RIS Documentation}
17
+ * @see {@link https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Reset} Xterm Control Sequences - Reset
18
+ */
19
+ declare const RESET_INITIAL_STATE: string;
20
20
  /**
21
- * Alias for {@link RESET_INITIAL_STATE} (Reset Initial State).
22
- *
23
- * Provides a shorter name for the RIS sequence `ESC c`.
24
- * @see {@link RESET_INITIAL_STATE}
25
- */
26
- export declare const RIS: string;
21
+ * Alias for {@link RESET_INITIAL_STATE} (Reset Initial State).
22
+ *
23
+ * Provides a shorter name for the RIS sequence `ESC c`.
24
+ * @see {@link RESET_INITIAL_STATE}
25
+ */
26
+ declare const RIS: string;
27
+ export { RESET_INITIAL_STATE, RIS };
package/dist/reset.js CHANGED
@@ -1,4 +1 @@
1
- const RESET_INITIAL_STATE = "\x1Bc";
2
- const RIS = RESET_INITIAL_STATE;
3
-
4
- export { RESET_INITIAL_STATE, RIS };
1
+ const I="\x1Bc",T="\x1Bc";export{I as RESET_INITIAL_STATE,T as RIS};