@visulima/ansi 4.0.0-alpha.15 → 4.0.0-alpha.17

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 (44) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/LICENSE.md +0 -17
  3. package/README.md +38 -10
  4. package/dist/alternative-screen.js +1 -1
  5. package/dist/clear.js +1 -1
  6. package/dist/clipboard.d.ts +76 -0
  7. package/dist/clipboard.js +1 -0
  8. package/dist/constants.d.ts +21 -0
  9. package/dist/constants.js +1 -0
  10. package/dist/cursor.js +1 -1
  11. package/dist/erase.js +1 -1
  12. package/dist/hyperlink.d.ts +0 -25
  13. package/dist/hyperlink.js +1 -1
  14. package/dist/image.d.ts +3 -4
  15. package/dist/image.js +1 -1
  16. package/dist/index.d.ts +5 -43
  17. package/dist/index.js +1 -1
  18. package/dist/iterm2.js +1 -1
  19. package/dist/mode.js +1 -1
  20. package/dist/mouse.js +1 -1
  21. package/dist/packem_shared/IT2_AUTO-K3GubKy7.js +1 -0
  22. package/dist/packem_shared/ITerm2File-BkLc5ipB.js +1 -0
  23. package/dist/packem_shared/cursor-BXG1O_IE.js +1 -0
  24. package/dist/packem_shared/restoreCursor-CyaXIMQf.js +2 -0
  25. package/dist/passthrough.js +1 -1
  26. package/dist/progress.d.ts +42 -0
  27. package/dist/progress.js +1 -0
  28. package/dist/screen.js +1 -1
  29. package/dist/scroll.js +1 -1
  30. package/dist/status.js +1 -1
  31. package/dist/strip.d.ts +25 -0
  32. package/dist/strip.js +1 -1
  33. package/dist/termcap.js +1 -1
  34. package/dist/title.js +1 -1
  35. package/dist/window-ops.js +1 -1
  36. package/dist/xterm.d.ts +83 -1
  37. package/dist/xterm.js +1 -1
  38. package/package.json +13 -1
  39. package/dist/packem_shared/IT2_AUTO-OiB8EaxU.js +0 -1
  40. package/dist/packem_shared/ITerm2File-XoC8RMzs.js +0 -1
  41. package/dist/packem_shared/constants-D12jy2Zh.js +0 -1
  42. package/dist/packem_shared/cursor-BAcJR4p_.js +0 -1
  43. package/dist/packem_shared/resetProgressBar-H_gzPKNE.js +0 -1
  44. package/dist/packem_shared/restoreCursor-CHy0jZuu.js +0 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,48 @@
1
+ ## @visulima/ansi [4.0.0-alpha.17](https://github.com/visulima/visulima/compare/@visulima/ansi@4.0.0-alpha.16...@visulima/ansi@4.0.0-alpha.17) (2026-06-13)
2
+
3
+ ### Features
4
+
5
+ * **ansi:** add osc52 clipboard + kitty keyboard, harden strip ([793cc9e](https://github.com/visulima/visulima/commit/793cc9e848aabe4b7b637a855941eb1f40649c94))
6
+
7
+ ### Bug Fixes
8
+
9
+ * **ansi:** strip 8-bit C1 control sequences (0x9b CSI, 0x9d OSC, …) ([ecd702d](https://github.com/visulima/visulima/commit/ecd702ded915ae4affd2a0a65583d73819d9e8b3))
10
+
11
+ ### Code Refactoring
12
+
13
+ * **ansi:** use replaceAll and reflow single-line arrow ([2f1525c](https://github.com/visulima/visulima/commit/2f1525c9176f0e7c65148fd2ac89b8cdb68a7b7e))
14
+
15
+ ### Build System
16
+
17
+ * regenerate bundled-license manifests and types ordering ([af26588](https://github.com/visulima/visulima/commit/af26588d75aaa937fd4862800560bd4070a4878c))
18
+
19
+
20
+ ### Dependencies
21
+
22
+ * **@visulima/colorize:** upgraded to 2.0.0-alpha.14
23
+ * **@visulima/path:** upgraded to 3.0.0-alpha.13
24
+
25
+ ## @visulima/ansi [4.0.0-alpha.16](https://github.com/visulima/visulima/compare/@visulima/ansi@4.0.0-alpha.15...@visulima/ansi@4.0.0-alpha.16) (2026-06-04)
26
+
27
+ ### Bug Fixes
28
+
29
+ * **ansi:** 3 bug fixes ([5b6977c](https://github.com/visulima/visulima/commit/5b6977caa2479f094ec4e04125127e06275c3aae))
30
+ * **lint:** clear pre-existing eslint rot across packages ([#674](https://github.com/visulima/visulima/issues/674)) ([5354253](https://github.com/visulima/visulima/commit/5354253b163bd50bcefaf8a3fddf831bdb5df32b))
31
+
32
+ ### Miscellaneous Chores
33
+
34
+ * apply eslint + prettier autofixes across packages ([c1bb784](https://github.com/visulima/visulima/commit/c1bb7848a0d93d0dfe2960c77e3cda22239c79a0))
35
+
36
+ ### Tests
37
+
38
+ * **ansi:** cover cursor moves, iterm2 file data, xterm/title guards, device-attribute reports and barrel ([13cd284](https://github.com/visulima/visulima/commit/13cd2848b0927d8150b5c8e8a2c24526ff3bdc57))
39
+
40
+
41
+ ### Dependencies
42
+
43
+ * **@visulima/colorize:** upgraded to 2.0.0-alpha.13
44
+ * **@visulima/path:** upgraded to 3.0.0-alpha.12
45
+
1
46
  ## @visulima/ansi [4.0.0-alpha.15](https://github.com/visulima/visulima/compare/@visulima/ansi@4.0.0-alpha.14...@visulima/ansi@4.0.0-alpha.15) (2026-05-27)
2
47
 
3
48
  ### Bug Fixes
package/LICENSE.md CHANGED
@@ -27,23 +27,6 @@ The published @visulima/ansi artifact additionally contains code with the follow
27
27
  ISC, MIT
28
28
 
29
29
  # Bundled dependencies:
30
- ## ansi-regex
31
- License: MIT
32
- By: Sindre Sorhus
33
- Repository: chalk/ansi-regex
34
-
35
- > MIT License
36
- >
37
- > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
38
- >
39
- > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
40
- >
41
- > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
42
- >
43
- > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
44
-
45
- ---------------------------------------
46
-
47
30
  ## mimic-function
48
31
  License: MIT
49
32
  By: Sindre Sorhus
package/README.md CHANGED
@@ -82,10 +82,10 @@ import { cursorUp, cursorLeft } from "@visulima/ansi/cursor";
82
82
  // etc, as above...
83
83
  ```
84
84
 
85
- And for commonjs:
85
+ `@visulima/ansi` is ESM-only. In a CommonJS module, load it with a dynamic `import()`:
86
86
 
87
87
  ```js
88
- const { cursorUp, cursorLeft } = require("@visulima/ansi");
88
+ const { cursorUp, cursorLeft } = await import("@visulima/ansi");
89
89
 
90
90
  // etc, as above...
91
91
  ```
@@ -110,10 +110,10 @@ process.stdout.write(eraseLine);
110
110
  **Screen Clearing**
111
111
 
112
112
  ```javascript
113
- import { clearScreen, eraseDown } from "@visulima/ansi";
113
+ import { clearScreenAndHomeCursor, eraseDown } from "@visulima/ansi";
114
114
 
115
- // Clear the entire screen
116
- process.stdout.write(clearScreen);
115
+ // Clear the entire screen and move the cursor to the top-left
116
+ process.stdout.write(clearScreenAndHomeCursor);
117
117
 
118
118
  // Clear from cursor to end of screen
119
119
  process.stdout.write(eraseDown);
@@ -153,6 +153,17 @@ This package exports the following functions and constants. For a detailed list
153
153
  - `clearScreenFromTopLeft`
154
154
  - `resetTerminal`
155
155
 
156
+ **Clipboard** (from `clipboard.ts`)
157
+
158
+ - `setClipboard` — write text to the terminal clipboard via OSC 52 (works over SSH/tmux)
159
+ - `requestClipboard` — request the clipboard contents
160
+ - `clearClipboard` — clear a clipboard selection
161
+ - `ClipboardSelection` (type)
162
+
163
+ **Constants** (from `constants.ts`)
164
+
165
+ - `ESC`, `CSI`, `OSC`, `BEL`, `SEP`, `DCS`, `ST`, `APC`, `SOS`, `PM` — low-level sequence primitives for composing custom escape sequences
166
+
156
167
  **Cursor** (from `cursor.ts`)
157
168
 
158
169
  - `CURSOR_BACKWARD_1`
@@ -291,6 +302,14 @@ This package exports the following functions and constants. For a detailed list
291
302
  - `screenPassthrough`
292
303
  - `tmuxPassthrough`
293
304
 
305
+ **Progress** (from `progress.ts`)
306
+
307
+ - `resetProgressBar`
308
+ - `setProgressBar`
309
+ - `setErrorProgressBar`
310
+ - `setIndeterminateProgressBar`
311
+ - `setWarningProgressBar`
312
+
294
313
  **Reset** (from `reset.ts`)
295
314
 
296
315
  - `RESET_INITIAL_STATE`
@@ -404,11 +423,20 @@ This package exports the following functions and constants. For a detailed list
404
423
 
405
424
  **XTerm** (from `xterm.ts`)
406
425
 
407
- - `xtermBell`
408
- - `xtermManipulateWindow`
409
- - `xtermReport`
410
- - `xtermRequest`
411
- - `xtermSet`
426
+ - `keyModifierOptions` / `XTMODKEYS`
427
+ - `queryKeyModifierOptions` / `XTQMODKEYS`
428
+ - `setKeyModifierOptions`
429
+ - `resetKeyModifierOptions`
430
+ - `setModifyOtherKeys1`
431
+ - `setModifyOtherKeys2`
432
+ - `resetModifyOtherKeys`
433
+ - `queryModifyOtherKeys`
434
+ - `pushKittyKeyboard` — push Kitty keyboard protocol flags (`CSI > flags u`)
435
+ - `popKittyKeyboard` — pop flags off the stack (`CSI < n u`)
436
+ - `setKittyKeyboard` — set flags in place (`CSI = flags ; 1 u`)
437
+ - `queryKittyKeyboard` — query current flags (`CSI ? u`)
438
+ - `KittyKeyboardFlag` — bit-flag constants
439
+ - `KittyKeyboardFlags` (type)
412
440
 
413
441
  ## Related
414
442
 
@@ -1 +1 @@
1
- var c=Object.defineProperty;var t=(e,r)=>c(e,"name",{value:r,configurable:!0});import{C as a}from"./packem_shared/constants-D12jy2Zh.js";var f=Object.defineProperty,n=t((e,r)=>f(e,"name",{value:r,configurable:!0}),"t");const i=`${a}?1049h`,l=`${a}?1049l`,O=n(()=>i,"alternativeScreenOn"),S=n(()=>l,"alternativeScreenOff");export{l as ALT_SCREEN_OFF,i as ALT_SCREEN_ON,S as alternativeScreenOff,O as alternativeScreenOn};
1
+ import{CSI as e}from"./constants.js";const r=`${e}?1049h`,t=`${e}?1049l`,S=()=>r,a=()=>t;export{t as ALT_SCREEN_OFF,r as ALT_SCREEN_ON,a as alternativeScreenOff,S as alternativeScreenOn};
package/dist/clear.js CHANGED
@@ -1 +1 @@
1
- import{C as n,E as o}from"./packem_shared/constants-D12jy2Zh.js";import{u as i,A as s}from"./packem_shared/cursor-BAcJR4p_.js";import{eraseDisplay as e,EraseDisplayMode as r,eraseInLine as a,EraseLineMode as c}from"./erase.js";const $=i(0,0)+e(r.ToEnd),S=`${a(c.EntireLine)}${n}G`,l=`${n}H${e(r.EntireScreen)}`,d=s?`${e(r.EntireScreen)}${n}0f`:`${e(r.EntireScreen)}${e(r.EntireScreenAndScrollback)}${n}H${o}c`;export{S as clearLineAndHomeCursor,l as clearScreenAndHomeCursor,$ as clearScreenFromTopLeft,d as resetTerminal};
1
+ import{CSI as n,ESC as o}from"./constants.js";import{u as i,A as s}from"./packem_shared/cursor-BXG1O_IE.js";import{eraseInLine as c,eraseDisplay as e,EraseDisplayMode as r,EraseLineMode as a}from"./erase.js";const E=i(0,0)+e(r.ToEnd),S=`${c(a.EntireLine)}${n}G`,l=`${n}H${e(r.EntireScreen)}`,d=s?`${e(r.EntireScreen)}${n}0f`:`${e(r.EntireScreen)}${e(r.EntireScreenAndScrollback)}${n}H${o}c`;export{S as clearLineAndHomeCursor,l as clearScreenAndHomeCursor,E as clearScreenFromTopLeft,d as resetTerminal};
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Selection targets for OSC 52 clipboard operations.
3
+ *
4
+ * - `c` is the system clipboard (the common default).
5
+ * - `p` is the primary selection (X11 middle-click paste buffer).
6
+ * - `q` is the secondary selection.
7
+ * - `s` is the "select" selection.
8
+ * - `0` to `7` are numbered cut buffers.
9
+ *
10
+ * Multiple targets may be combined (e.g. `"cp"`) to write the same data to
11
+ * several selections at once.
12
+ * @see {@link https://invisible-island.net/xterm/ctlseqs/ctlseqs.html}
13
+ */
14
+ type ClipboardSelection = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "c" | "p" | "q" | "s" | (string & {});
15
+ /**
16
+ * Writes data to the terminal's clipboard using the OSC 52 escape sequence.
17
+ *
18
+ * Sequence: `OSC 52 ; selection ; base64-data ST`
19
+ *
20
+ * OSC 52 is the only clipboard mechanism that works over SSH/tmux, because the
21
+ * write travels in-band over the terminal stream rather than touching a local
22
+ * clipboard API. The terminal emulator must have clipboard writes enabled
23
+ * (e.g. `set-clipboard` in xterm, `allow-passthrough` plus `set-clipboard` in
24
+ * tmux); many enable it by default.
25
+ * @param data The text to place on the clipboard.
26
+ * @param selection The selection target(s). Defaults to `"c"` (system clipboard).
27
+ * @param terminator The OSC terminator to use. Defaults to {@link BEL}; pass
28
+ * {@link ST} (`ESC backslash`) for terminals that require the canonical String Terminator.
29
+ * @returns The OSC 52 escape sequence.
30
+ * @example
31
+ * ```typescript
32
+ * import { setClipboard } from "@visulima/ansi/clipboard";
33
+ *
34
+ * // Copy a generated token to the user's local clipboard from a remote shell.
35
+ * process.stdout.write(setClipboard("my-secret-token"));
36
+ * ```
37
+ * @see {@link https://invisible-island.net/xterm/ctlseqs/ctlseqs.html}
38
+ */
39
+ declare const setClipboard: (data: string, selection?: ClipboardSelection, terminator?: string) => string;
40
+ /**
41
+ * Requests the current contents of the terminal's clipboard via OSC 52.
42
+ *
43
+ * Sequence: `OSC 52 ; selection ; ? ST`
44
+ *
45
+ * The terminal responds with `OSC 52 ; selection ; base64-data ST` if it
46
+ * permits clipboard reads (frequently disabled for security). Decode the
47
+ * Base64 payload from the response to obtain the clipboard text.
48
+ * @param selection The selection target to query. Defaults to `"c"` (system clipboard).
49
+ * @param terminator The OSC terminator to use. Defaults to {@link BEL}; pass {@link ST} for terminals that require it.
50
+ * @returns The OSC 52 query escape sequence.
51
+ * @example
52
+ * ```typescript
53
+ * import { requestClipboard } from "@visulima/ansi/clipboard";
54
+ *
55
+ * process.stdout.write(requestClipboard());
56
+ * ```
57
+ * @see {@link https://invisible-island.net/xterm/ctlseqs/ctlseqs.html}
58
+ */
59
+ declare const requestClipboard: (selection?: ClipboardSelection, terminator?: string) => string;
60
+ /**
61
+ * Clears the terminal's clipboard for the given selection via OSC 52.
62
+ *
63
+ * Sequence: `OSC 52 ; selection ; ST` (an empty payload clears the selection).
64
+ * @param selection The selection target to clear. Defaults to `"c"` (system clipboard).
65
+ * @param terminator The OSC terminator to use. Defaults to {@link BEL}; pass {@link ST} for terminals that require it.
66
+ * @returns The OSC 52 clear escape sequence.
67
+ * @example
68
+ * ```typescript
69
+ * import { clearClipboard } from "@visulima/ansi/clipboard";
70
+ *
71
+ * process.stdout.write(clearClipboard());
72
+ * ```
73
+ * @see {@link https://invisible-island.net/xterm/ctlseqs/ctlseqs.html}
74
+ */
75
+ declare const clearClipboard: (selection?: ClipboardSelection, terminator?: string) => string;
76
+ export { ClipboardSelection, clearClipboard, requestClipboard, setClipboard };
@@ -0,0 +1 @@
1
+ import{OSC as e,BEL as n}from"./constants.js";const f=r=>{const o=new TextEncoder().encode(r),t=o.toBase64;if(typeof t=="function")return t.call(o);if(typeof btoa=="function"){let i="";for(const c of o)i+=String.fromCodePoint(c);return btoa(i)}const a=globalThis.Buffer;if(a===void 0)throw new Error("No Base64 encoder available: Uint8Array.prototype.toBase64, btoa and Buffer are all missing.");return a.from(o).toString("base64")},l=(r,o="c",t=n)=>`${e}52;${o};${f(r)}${t}`,$=(r="c",o=n)=>`${e}52;${r};?${o}`,b=(r="c",o=n)=>`${e}52;${r};${o}`;export{b as clearClipboard,$ as requestClipboard,l as setClipboard};
@@ -0,0 +1,21 @@
1
+ /** Escape character (\u001B). */
2
+ declare const ESC: string;
3
+ /** Control Sequence Introducer (ESC [). */
4
+ declare const CSI: string;
5
+ /** Operating System Command (ESC ]). */
6
+ declare const OSC: string;
7
+ /** Bell character (\u0007). Often used to terminate OSC sequences. */
8
+ declare const BEL: string;
9
+ /** Separator used in some ANSI sequences, typically a semicolon. */
10
+ declare const SEP: string;
11
+ /** Device Control String (ESC P). */
12
+ declare const DCS: string;
13
+ /** String Terminator (ESC \\). Used to terminate DCS, SOS, PM, APC sequences. */
14
+ declare const ST: string;
15
+ /** Application Program Command (ESC _). */
16
+ declare const APC: string;
17
+ /** Start of String (ESC X). */
18
+ declare const SOS: string;
19
+ /** Privacy Message (ESC ^). */
20
+ declare const PM: string;
21
+ export { APC, BEL, CSI, DCS, ESC, OSC, PM, SEP, SOS, ST };
@@ -0,0 +1 @@
1
+ const x="\x1B",B="\x1B[",S="\x1B]",C="\x07",P=";",E="\x1BP",o="\x1B\\",t="\x1B_",O="\x1BX",c="\x1B^";export{t as APC,C as BEL,B as CSI,E as DCS,x as ESC,S as OSC,c as PM,P as SEP,O as SOS,o as ST};
package/dist/cursor.js CHANGED
@@ -1 +1 @@
1
- import"./packem_shared/constants-D12jy2Zh.js";import{C as o,a as u,b as e,c as R,B as c,R as t,d as S,e as C,S as _,f as O,g as E,h as U,i,j as l,k as T,l as n,m as D,n as d,o as w,p as A,q as b,r as f,s as m,t as p,u as N,v as P,w as v,x,y as B,z as I}from"./packem_shared/cursor-BAcJR4p_.js";import{default as k}from"./packem_shared/restoreCursor-CHy0jZuu.js";export{o as CURSOR_BACKWARD_1,u as CURSOR_DOWN_1,e as CURSOR_FORWARD_1,R as CURSOR_UP_1,c as CursorStyle,t as REQUEST_CURSOR_POSITION,S as REQUEST_EXTENDED_CURSOR_POSITION,C as RESTORE_CURSOR_DEC,_ as SAVE_CURSOR_DEC,O as cursorBackward,E as cursorBackwardTab,U as cursorDown,i as cursorForward,l as cursorHide,T as cursorHorizontalAbsolute,n as cursorHorizontalForwardTab,D as cursorLeft,d as cursorMove,w as cursorNextLine,A as cursorPosition,b as cursorPreviousLine,f as cursorRestore,m as cursorSave,p as cursorShow,N as cursorTo,P as cursorToColumn1,v as cursorUp,x as cursorVerticalAbsolute,B as eraseCharacter,k as restoreCursor,I as setCursorStyle};
1
+ import"./constants.js";import{C as o,a as u,b as e,c as R,B as c,R as t,d as S,e as C,S as _,f as O,g as E,h as U,i,j as l,k as T,l as n,m as D,n as d,o as w,p as A,q as b,r as f,s as m,t as p,u as N,v as P,w as v,x,y as B,z as I}from"./packem_shared/cursor-BXG1O_IE.js";import{default as k}from"./packem_shared/restoreCursor-CyaXIMQf.js";export{o as CURSOR_BACKWARD_1,u as CURSOR_DOWN_1,e as CURSOR_FORWARD_1,R as CURSOR_UP_1,c as CursorStyle,t as REQUEST_CURSOR_POSITION,S as REQUEST_EXTENDED_CURSOR_POSITION,C as RESTORE_CURSOR_DEC,_ as SAVE_CURSOR_DEC,O as cursorBackward,E as cursorBackwardTab,U as cursorDown,i as cursorForward,l as cursorHide,T as cursorHorizontalAbsolute,n as cursorHorizontalForwardTab,D as cursorLeft,d as cursorMove,w as cursorNextLine,A as cursorPosition,b as cursorPreviousLine,f as cursorRestore,m as cursorSave,p as cursorShow,N as cursorTo,P as cursorToColumn1,v as cursorUp,x as cursorVerticalAbsolute,B as eraseCharacter,k as restoreCursor,I as setCursorStyle};
package/dist/erase.js CHANGED
@@ -1 +1 @@
1
- var t=Object.defineProperty;var s=(e,n)=>t(e,"name",{value:n,configurable:!0});import{C as c}from"./packem_shared/constants-D12jy2Zh.js";import{w as l,v as E}from"./packem_shared/cursor-BAcJR4p_.js";var S=Object.defineProperty,a=s((e,n)=>S(e,"name",{value:n,configurable:!0}),"o"),d=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireScreen=2]="EntireScreen",e[e.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",e))(d||{});const r=a(e=>{const n=e>=0&&e<=3?e:0;return`${c}${n===0?"":String(n)}J`},"eraseDisplay");var g=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireLine=2]="EntireLine",e))(g||{});const o=a(e=>{const n=e>=0&&e<=2?e:0;return`${c}${n===0?"":String(n)}K`},"eraseInLine"),f=r(0),u=o(2),m=o(0),v=o(1),b=a(e=>{if(e<=0)return"";let n="";for(let i=0;i<e;i+=1)n+=u,i<e-1&&(n+=l());return n+=E,n},"eraseLines"),y=r(2),B=r(1),D=r(3);export{d as EraseDisplayMode,g as EraseLineMode,r as eraseDisplay,f as eraseDown,o as eraseInLine,u as eraseLine,m as eraseLineEnd,v as eraseLineStart,b as eraseLines,y as eraseScreen,D as eraseScreenAndScrollback,B as eraseUp};
1
+ import{CSI as s}from"./constants.js";import{v as a,w as c}from"./packem_shared/cursor-BXG1O_IE.js";var t=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireScreen=2]="EntireScreen",e[e.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",e))(t||{});const r=e=>{const n=e>=0&&e<=3?e:0;return`${s}${n===0?"":String(n)}J`};var E=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireLine=2]="EntireLine",e))(E||{});const o=e=>{const n=e>=0&&e<=2?e:0;return`${s}${n===0?"":String(n)}K`},g=r(0),S=o(2),T=o(0),L=o(1),p=e=>{if(e<=0)return"";let n="";for(let i=0;i<e;i+=1)n+=S,i<e-1&&(n+=c());return n+=a,n},u=r(2),m=r(1),f=r(3);export{t as EraseDisplayMode,E as EraseLineMode,r as eraseDisplay,g as eraseDown,o as eraseInLine,S as eraseLine,T as eraseLineEnd,L as eraseLineStart,p as eraseLines,u as eraseScreen,f as eraseScreenAndScrollback,m as eraseUp};
@@ -1,27 +1,2 @@
1
- /**
2
- * Creates a clickable hyperlink in the terminal.
3
- *
4
- * This function constructs an ANSI escape sequence that, when printed to a compatible terminal,
5
- * renders as a clickable link. The link's visible text and its target URL are specified
6
- * by the `text` and `url` parameters, respectively.
7
- *
8
- * For information on terminal support for hyperlinks, see this
9
- * [Gist by Egmont Kob](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda).
10
- * To programmatically check for hyperlink support in the current environment,
11
- * consider using a library like [`supports-hyperlinks`](https://github.com/jamestalmage/supports-hyperlinks).
12
- * @param text The visible text of the link.
13
- * @param url The URL the link should point to.
14
- * @returns A string representing the ANSI escape sequence for the hyperlink.
15
- * @example
16
- * ```typescript
17
- * import { hyperlink } from "@visulima/ansi/hyperlink"; // Adjust import path as needed
18
- *
19
- * const aLink = hyperlink("Visulima", "https://www.visulima.com");
20
- * console.log(`Visit ${aLink} for more information.`);
21
- * // In a supported terminal, this will output:
22
- * // Visit Visulima for more information. (where "Visulima" is a clickable link)
23
- * ```
24
- * @see {@link https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda} for supported terminals.
25
- */
26
1
  declare const hyperlink: (text: string, url: string) => string;
27
2
  export { hyperlink as default };
package/dist/hyperlink.js CHANGED
@@ -1 +1 @@
1
- var i=Object.defineProperty;var n=(e,a)=>i(e,"name",{value:a,configurable:!0});import{O as o,S as r,B as t}from"./packem_shared/constants-D12jy2Zh.js";var s=Object.defineProperty,f=n((e,a)=>s(e,"name",{value:a,configurable:!0}),"n");const u=f((e,a)=>[o,"8",r,r,a,t,e,o,"8",r,r,t].join(""),"hyperlink");export{u as default};
1
+ import{OSC as l,SEP as e,BEL as o}from"./constants.js";const r=/[]/g,i=(t,c)=>{const n=c.replaceAll(r,""),a=t.replaceAll(r,"");return[l,"8",e,e,n,o,a,l,"8",e,e,o].join("")};export{i as default};
package/dist/image.d.ts CHANGED
@@ -37,7 +37,6 @@ interface ImageOptions {
37
37
  * @param options Optional parameters to control how the image is displayed (e.g., width, height, aspect ratio).
38
38
  * See {@link ImageOptions}.
39
39
  * @returns A string containing the ANSI escape sequence for displaying the image in iTerm2.
40
- * Returns an empty string if `data` is null or undefined, though TypeScript should prevent this.
41
40
  * @example
42
41
  * ```typescript
43
42
  * import { image } from '@visulima/ansi/image'; // Adjust import path
@@ -61,9 +60,9 @@ interface ImageOptions {
61
60
  * ```
62
61
  * @remarks
63
62
  * - This sequence is specific to iTerm2 and may not work in other terminal emulators.
64
- * - For Node.js environments, `Buffer.from(data).toString("base64")` is used for Base64 encoding.
65
- * In browser environments, a polyfill or an alternative method for Base64 encoding `Uint8Array` would be necessary
66
- * if `Buffer` is not available (e.g., `btoa(String.fromCharCode(...data))` after careful handling of binary data).
63
+ * - Base64 encoding is runtime-agnostic: it prefers the standardized
64
+ * `Uint8Array.prototype.toBase64` (Node ≥ 24, modern browsers), then `btoa`,
65
+ * then Node's `Buffer`, so the helper works in browser/xterm.js bundles too.
67
66
  * - The `name` parameter (for filename) is not directly supported by this simplified helper but is part of the
68
67
  * full iTerm2 inline image protocol. For more advanced features, consider using the more detailed iTerm2 sequence
69
68
  * builders in `iterm2/` files.
package/dist/image.js CHANGED
@@ -1 +1 @@
1
- var n=Object.defineProperty;var o=(r,e)=>n(r,"name",{value:e,configurable:!0});import{createRequire as a}from"node:module";import{O as l,B as p}from"./packem_shared/constants-D12jy2Zh.js";const c=a(import.meta.url),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=o(r=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[e,t]=i.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return i.getBuiltinModule(r)}return c(r)},"__cjs_getBuiltinModule"),{Buffer:f}=u("node:buffer");var d=Object.defineProperty,g=o((r,e)=>d(r,"name",{value:e,configurable:!0}),"i");const v=g((r,e={})=>{let t=`${l}1337;File=inline=1`;e.width!==void 0&&(t+=`;width=${String(e.width)}`),e.height!==void 0&&(t+=`;height=${String(e.height)}`),e.preserveAspectRatio===!1&&(t+=";preserveAspectRatio=0");const s=f.from(r).toString("base64");return`${t}:${s}${p}`},"image");export{v as image};
1
+ import{OSC as n,BEL as a}from"./constants.js";const s=e=>{const t=e.toBase64;if(typeof t=="function")return t.call(e);if(typeof btoa=="function"){let i="";for(const r of e)i+=String.fromCodePoint(r);return btoa(i)}const o=globalThis.Buffer;if(o===void 0)throw new Error("No Base64 encoder available: Uint8Array.prototype.toBase64, btoa and Buffer are all missing.");return o.from(e).toString("base64")},l=(e,t={})=>{let o=`${n}1337;File=inline=1`;t.width!==void 0&&(o+=`;width=${String(t.width)}`),t.height!==void 0&&(o+=`;height=${String(t.height)}`),t.preserveAspectRatio===!1&&(o+=";preserveAspectRatio=0");const i=s(e);return`${o}:${i}${a}`};export{l as image};
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export { ALT_SCREEN_OFF, ALT_SCREEN_ON, alternativeScreenOff, alternativeScreenOn } from "./alternative-screen.js";
2
2
  export { clearLineAndHomeCursor, clearScreenAndHomeCursor, clearScreenFromTopLeft, resetTerminal } from "./clear.js";
3
+ export { type ClipboardSelection, clearClipboard, requestClipboard, setClipboard } from "./clipboard.js";
4
+ export { APC, BEL, CSI, DCS, ESC, OSC, PM, SEP, SOS, ST } from "./constants.js";
3
5
  export { CURSOR_BACKWARD_1, CURSOR_DOWN_1, CURSOR_FORWARD_1, CURSOR_UP_1, type CursorStyle, REQUEST_CURSOR_POSITION, REQUEST_EXTENDED_CURSOR_POSITION, RESTORE_CURSOR_DEC, SAVE_CURSOR_DEC, cursorBackward, cursorBackwardTab, cursorDown, cursorForward, cursorHide, cursorHorizontalAbsolute, cursorHorizontalForwardTab, cursorLeft, cursorMove, cursorNextLine, cursorPosition, cursorPreviousLine, cursorRestore, cursorSave, cursorShow, cursorTo, cursorToColumn1, cursorUp, cursorVerticalAbsolute, eraseCharacter, setCursorStyle } from "./cursor.js";
4
6
  export { type EraseDisplayMode, type EraseLineMode, eraseDisplay, eraseDown, eraseInLine, eraseLine, eraseLineEnd, eraseLineStart, eraseLines, eraseScreen, eraseScreenAndScrollback, eraseUp } from "./erase.js";
5
7
  export { default as hyperlink } from "./hyperlink.js";
@@ -8,6 +10,7 @@ export { type IITerm2Payload, IT2_AUTO, ITerm2File, ITerm2FileEnd, ITerm2FilePar
8
10
  export { type AnsiMode, BDSM, BiDirectionalSupportMode, BracketedPasteMode, DECRPM, DECRQM, type DecMode, DisableModifiersMode, IRM, InBandResizeMode, InsertReplaceMode, KAM, KeyboardActionMode, LNM, LightDarkMode, LineFeedNewLineMode, LocalEchoMode, type Mode, type ModeSetting, OriginMode, RM, RequestBiDirectionalSupportMode, RequestInBandResizeMode, RequestInsertReplaceMode, RequestKeyboardActionMode, RequestLineFeedNewLineMode, RequestLocalEchoMode, RequestSendReceiveMode, RequestUnicodeCoreMode, ResetBiDirectionalSupportMode, ResetInBandResizeMode, ResetInsertReplaceMode, ResetKeyboardActionMode, ResetLineFeedNewLineMode, ResetLocalEchoMode, ResetSendReceiveMode, ResetUnicodeCoreMode, SGRMouseMode, SM, SRM, SendFocusEventsMode, SendReceiveMode, SetBiDirectionalSupportMode, SetInBandResizeMode, SetInsertReplaceMode, SetKeyboardActionMode, SetLineFeedNewLineMode, SetLocalEchoMode, SetSendReceiveMode, SetUnicodeCoreMode, TextCursorEnableMode, UnicodeCoreMode, createAnsiMode, createDecMode, isModeNotRecognized, isModePermanentlyReset, isModePermanentlySet, isModeReset, isModeSet, reportMode, requestMode, resetMode, setMode } from "./mode.js";
9
11
  export { MouseButton, type MouseButtonType, type MouseModifiers, disableAnyEventMouse, disableButtonEventMouse, disableFocusTracking, disableNormalMouse, disableSgrMouse, disableX10Mouse, enableAnyEventMouse, enableButtonEventMouse, enableFocusTracking, enableNormalMouse, enableSgrMouse, enableX10Mouse, encodeMouseButtonByte, mouseSgrSequence, mouseX10Sequence } from "./mouse.js";
10
12
  export { SCREEN_MAX_LEN_DEFAULT, SCREEN_TYPICAL_LIMIT, screenPassthrough, tmuxPassthrough } from "./passthrough.js";
13
+ export { resetProgressBar, setErrorProgressBar, setIndeterminateProgressBar, setProgressBar, setWarningProgressBar } from "./progress.js";
11
14
  export { RESET_INITIAL_STATE, RIS } from "./reset.js";
12
15
  export { clearTabStop, deleteCharacter, deleteLine, insertCharacter, insertLine, repeatPreviousCharacter, requestPresentationStateReport, setLeftRightMargins, setTopBottomMargins } from "./screen.js";
13
16
  export { SCROLL_DOWN_1, SCROLL_UP_1, scrollDown, scrollUp } from "./scroll.js";
@@ -16,51 +19,10 @@ export { default as strip } from "./strip.js";
16
19
  export { XTGETTCAP, requestTermcap, requestTerminfo } from "./termcap.js";
17
20
  export { decsin, decswt, setIconName, setIconNameAndWindowTitle, setIconNameAndWindowTitleWithST, setIconNameWithST, setWindowTitle, setWindowTitleWithST } from "./title.js";
18
21
  export { XTWINOPS, type XTermWindowOp, deiconifyWindow, iconifyWindow, lowerWindow, maximizeWindow, moveWindow, raiseWindow, refreshWindow, reportWindowPosition, reportWindowState, requestCellSizePixels, requestTextAreaSizeChars, requestTextAreaSizePixels, resizeTextAreaChars, resizeTextAreaPixels, restoreMaximizedWindow, setPageSizeLines, xtermWindowOp } from "./window-ops.js";
19
- export { XTMODKEYS, XTQMODKEYS, keyModifierOptions, queryKeyModifierOptions, queryModifyOtherKeys, resetKeyModifierOptions, resetModifyOtherKeys, setKeyModifierOptions, setModifyOtherKeys1, setModifyOtherKeys2 } from "./xterm.js";
22
+ export { KittyKeyboardFlag, type KittyKeyboardFlags, XTMODKEYS, XTQMODKEYS, keyModifierOptions, popKittyKeyboard, pushKittyKeyboard, queryKeyModifierOptions, queryKittyKeyboard, queryModifyOtherKeys, resetKeyModifierOptions, resetModifyOtherKeys, setKeyModifierOptions, setKittyKeyboard, setModifyOtherKeys1, setModifyOtherKeys2 } from "./xterm.js";
20
23
  import 'type-fest';
21
24
  /**
22
- * Resets the progress bar to its default state (hidden).
23
- *
24
- * Sequence: `OSC 9 ; 4 ; 0 BEL`
25
- * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences}
26
- */
27
- declare const resetProgressBar: string;
28
- /**
29
- * Returns a sequence for setting the progress bar to a specific percentage (0-100) in the "default" state.
30
- *
31
- * Sequence: `OSC 9 ; 4 ; 1 ; Percentage BEL`
32
- * @param percentage The progress percentage (0-100, clamped automatically)
33
- * @returns The progress bar sequence
34
- * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences}
35
- */
36
- declare const setProgressBar: (percentage: number) => string;
37
- /**
38
- * Returns a sequence for setting the progress bar to a specific percentage (0-100) in the "Error" state.
39
- *
40
- * Sequence: `OSC 9 ; 4 ; 2 ; Percentage BEL`
41
- * @param percentage The progress percentage (0-100, clamped automatically)
42
- * @returns The error progress bar sequence
43
- * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences}
44
- */
45
- declare const setErrorProgressBar: (percentage: number) => string;
46
- /**
47
- * Sets the progress bar to the indeterminate state.
48
- *
49
- * Sequence: `OSC 9 ; 4 ; 3 BEL`
50
- * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences}
51
- */
52
- declare const setIndeterminateProgressBar: string;
53
- /**
54
- * Returns a sequence for setting the progress bar to a specific percentage (0-100) in the "Warning" state.
55
- *
56
- * Sequence: `OSC 9 ; 4 ; 4 ; Percentage BEL`
57
- * @param percentage The progress percentage (0-100, clamped automatically)
58
- * @returns The warning progress bar sequence
59
- * @see {@link https://learn.microsoft.com/en-us/windows/terminal/tutorials/progress-bar-sequences}
60
- */
61
- declare const setWarningProgressBar: (percentage: number) => string;
62
- /**
63
25
  * Output a beeping sound.
64
26
  */
65
27
  declare const beep = "\x07";
66
- export { beep, resetProgressBar, setErrorProgressBar, setIndeterminateProgressBar, setProgressBar, setWarningProgressBar };
28
+ export { beep };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{ALT_SCREEN_OFF as t,ALT_SCREEN_ON as s,alternativeScreenOff as i,alternativeScreenOn as a}from"./alternative-screen.js";import{clearLineAndHomeCursor as d,clearScreenAndHomeCursor as u,clearScreenFromTopLeft as c,resetTerminal as S}from"./clear.js";import{C as M,a as l,b as p,c as m,R as D,d as T,e as E,S as C,f as P,g as A,h as L,i as f,j as y,k as x,l as O,m as b,n as _,o as q,p as I,q as N,r as g,s as w,t as h,u as v,v as U,w as B,x as K,y as W,z as F}from"./packem_shared/cursor-BAcJR4p_.js";import{eraseDisplay as k,eraseDown as X,eraseInLine as H,eraseLine as Q,eraseLineEnd as V,eraseLineStart as Y,eraseLines as G,eraseScreen as j,eraseScreenAndScrollback as J,eraseUp as Z}from"./erase.js";import{default as ee}from"./hyperlink.js";import{image as oe}from"./image.js";import{iTerm2 as se}from"./iterm2.js";import{BDSM as ae,BiDirectionalSupportMode as ne,BracketedPasteMode as de,DECRPM as ue,DECRQM as ce,DisableModifiersMode as Se,IRM as Re,InBandResizeMode as Me,InsertReplaceMode as le,KAM as pe,KeyboardActionMode as me,LNM as De,LightDarkMode as Te,LineFeedNewLineMode as Ee,LocalEchoMode as Ce,OriginMode as Pe,RM as Ae,RequestBiDirectionalSupportMode as Le,RequestInBandResizeMode as fe,RequestInsertReplaceMode as ye,RequestKeyboardActionMode as xe,RequestLineFeedNewLineMode as Oe,RequestLocalEchoMode as be,RequestSendReceiveMode as _e,RequestUnicodeCoreMode as qe,ResetBiDirectionalSupportMode as Ie,ResetInBandResizeMode as Ne,ResetInsertReplaceMode as ge,ResetKeyboardActionMode as we,ResetLineFeedNewLineMode as he,ResetLocalEchoMode as ve,ResetSendReceiveMode as Ue,ResetUnicodeCoreMode as Be,SGRMouseMode as Ke,SM as We,SRM as Fe,SendFocusEventsMode as ze,SendReceiveMode as ke,SetBiDirectionalSupportMode as Xe,SetInBandResizeMode as He,SetInsertReplaceMode as Qe,SetKeyboardActionMode as Ve,SetLineFeedNewLineMode as Ye,SetLocalEchoMode as Ge,SetSendReceiveMode as je,SetUnicodeCoreMode as Je,TextCursorEnableMode as Ze,UnicodeCoreMode as $e,createAnsiMode as er,createDecMode as rr,isModeNotRecognized as or,isModePermanentlyReset as tr,isModePermanentlySet as sr,isModeReset as ir,isModeSet as ar,reportMode as nr,requestMode as dr,resetMode as ur,setMode as cr}from"./mode.js";import{MouseButton as Rr,disableAnyEventMouse as Mr,disableButtonEventMouse as lr,disableFocusTracking as pr,disableNormalMouse as mr,disableSgrMouse as Dr,disableX10Mouse as Tr,enableAnyEventMouse as Er,enableButtonEventMouse as Cr,enableFocusTracking as Pr,enableNormalMouse as Ar,enableSgrMouse as Lr,enableX10Mouse as fr,encodeMouseButtonByte as yr,mouseSgrSequence as xr,mouseX10Sequence as Or}from"./mouse.js";import{SCREEN_MAX_LEN_DEFAULT as _r,SCREEN_TYPICAL_LIMIT as qr,screenPassthrough as Ir,tmuxPassthrough as Nr}from"./passthrough.js";import{resetProgressBar as wr,setErrorProgressBar as hr,setIndeterminateProgressBar as vr,setProgressBar as Ur,setWarningProgressBar as Br}from"./packem_shared/resetProgressBar-H_gzPKNE.js";import{RESET_INITIAL_STATE as Wr,RIS as Fr}from"./reset.js";import{clearTabStop as kr,deleteCharacter as Xr,deleteLine as Hr,insertCharacter as Qr,insertLine as Vr,repeatPreviousCharacter as Yr,requestPresentationStateReport as Gr,setLeftRightMargins as jr,setTopBottomMargins as Jr}from"./screen.js";import{SCROLL_DOWN_1 as $r,SCROLL_UP_1 as eo,scrollDown as ro,scrollUp as oo}from"./scroll.js";import{CPR as so,DA1 as io,DA2 as ao,DA3 as no,DECXCPR as uo,DSR as co,DSR_KeyboardLanguageDEC as So,DSR_PrinterStatusDEC as Ro,DSR_TerminalStatus as Mo,DSR_UDKStatusDEC as lo,LightDarkReport as po,RequestLightDarkReport as mo,RequestNameVersion as Do,XTVERSION as To,createAnsiStatusReport as Eo,createDecStatusReport as Co,cursorPositionReport as Po,deviceStatusReport as Ao,extendedCursorPositionReport as Lo,reportKeyboardLanguageDEC as fo,reportPrimaryDeviceAttributes as yo,reportPrinterNoPaperDEC as xo,reportPrinterNotReadyDEC as Oo,reportPrinterReadyDEC as bo,reportSecondaryDeviceAttributes as _o,reportTerminalNotOK as qo,reportTerminalOK as Io,reportTertiaryDeviceAttributes as No,reportUDKLockedDEC as go,reportUDKUnlockedDEC as wo,requestCursorPositionReport as ho,requestExtendedCursorPositionReport as vo,requestKeyboardLanguageDEC as Uo,requestPrimaryDeviceAttributes as Bo,requestPrimaryDeviceAttributesParam0 as Ko,requestPrinterStatusDEC as Wo,requestSecondaryDeviceAttributes as Fo,requestSecondaryDeviceAttributesParam0 as zo,requestTerminalStatus as ko,requestTertiaryDeviceAttributes as Xo,requestTertiaryDeviceAttributesParam0 as Ho,requestUDKStatusDEC as Qo}from"./status.js";import{default as Yo}from"./strip.js";import{XTGETTCAP as jo,requestTermcap as Jo,requestTerminfo as Zo}from"./termcap.js";import{decsin as et,decswt as rt,setIconName as ot,setIconNameAndWindowTitle as tt,setIconNameAndWindowTitleWithST as st,setIconNameWithST as it,setWindowTitle as at,setWindowTitleWithST as nt}from"./title.js";import{XTWINOPS as ut,deiconifyWindow as ct,iconifyWindow as St,lowerWindow as Rt,maximizeWindow as Mt,moveWindow as lt,raiseWindow as pt,refreshWindow as mt,reportWindowPosition as Dt,reportWindowState as Tt,requestCellSizePixels as Et,requestTextAreaSizeChars as Ct,requestTextAreaSizePixels as Pt,resizeTextAreaChars as At,resizeTextAreaPixels as Lt,restoreMaximizedWindow as ft,setPageSizeLines as yt,xtermWindowOp as xt}from"./window-ops.js";import{XTMODKEYS as bt,XTQMODKEYS as _t,keyModifierOptions as qt,queryKeyModifierOptions as It,queryModifyOtherKeys as Nt,resetKeyModifierOptions as gt,resetModifyOtherKeys as wt,setKeyModifierOptions as ht,setModifyOtherKeys1 as vt,setModifyOtherKeys2 as Ut}from"./xterm.js";import{IT2_AUTO as Kt,it2Cells as Wt,it2Percent as Ft,it2Pixels as zt}from"./packem_shared/IT2_AUTO-OiB8EaxU.js";import{ITerm2File as Xt,ITerm2FileEnd as Ht,ITerm2FilePart as Qt,ITerm2MultipartFileStart as Vt}from"./packem_shared/ITerm2File-XoC8RMzs.js";const e="\x07";export{t as ALT_SCREEN_OFF,s as ALT_SCREEN_ON,ae as BDSM,ne as BiDirectionalSupportMode,de as BracketedPasteMode,so as CPR,M as CURSOR_BACKWARD_1,l as CURSOR_DOWN_1,p as CURSOR_FORWARD_1,m as CURSOR_UP_1,io as DA1,ao as DA2,no as DA3,ue as DECRPM,ce as DECRQM,uo as DECXCPR,co as DSR,So as DSR_KeyboardLanguageDEC,Ro as DSR_PrinterStatusDEC,Mo as DSR_TerminalStatus,lo as DSR_UDKStatusDEC,Se as DisableModifiersMode,Re as IRM,Kt as IT2_AUTO,Xt as ITerm2File,Ht as ITerm2FileEnd,Qt as ITerm2FilePart,Vt as ITerm2MultipartFileStart,Me as InBandResizeMode,le as InsertReplaceMode,pe as KAM,me as KeyboardActionMode,De as LNM,Te as LightDarkMode,po as LightDarkReport,Ee as LineFeedNewLineMode,Ce as LocalEchoMode,Rr as MouseButton,Pe as OriginMode,D as REQUEST_CURSOR_POSITION,T as REQUEST_EXTENDED_CURSOR_POSITION,Wr as RESET_INITIAL_STATE,E as RESTORE_CURSOR_DEC,Fr as RIS,Ae as RM,Le as RequestBiDirectionalSupportMode,fe as RequestInBandResizeMode,ye as RequestInsertReplaceMode,xe as RequestKeyboardActionMode,mo as RequestLightDarkReport,Oe as RequestLineFeedNewLineMode,be as RequestLocalEchoMode,Do as RequestNameVersion,_e as RequestSendReceiveMode,qe as RequestUnicodeCoreMode,Ie as ResetBiDirectionalSupportMode,Ne as ResetInBandResizeMode,ge as ResetInsertReplaceMode,we as ResetKeyboardActionMode,he as ResetLineFeedNewLineMode,ve as ResetLocalEchoMode,Ue as ResetSendReceiveMode,Be as ResetUnicodeCoreMode,C as SAVE_CURSOR_DEC,_r as SCREEN_MAX_LEN_DEFAULT,qr as SCREEN_TYPICAL_LIMIT,$r as SCROLL_DOWN_1,eo as SCROLL_UP_1,Ke as SGRMouseMode,We as SM,Fe as SRM,ze as SendFocusEventsMode,ke as SendReceiveMode,Xe as SetBiDirectionalSupportMode,He as SetInBandResizeMode,Qe as SetInsertReplaceMode,Ve as SetKeyboardActionMode,Ye as SetLineFeedNewLineMode,Ge as SetLocalEchoMode,je as SetSendReceiveMode,Je as SetUnicodeCoreMode,Ze as TextCursorEnableMode,$e as UnicodeCoreMode,jo as XTGETTCAP,bt as XTMODKEYS,_t as XTQMODKEYS,To as XTVERSION,ut as XTWINOPS,i as alternativeScreenOff,a as alternativeScreenOn,e as beep,d as clearLineAndHomeCursor,u as clearScreenAndHomeCursor,c as clearScreenFromTopLeft,kr as clearTabStop,er as createAnsiMode,Eo as createAnsiStatusReport,rr as createDecMode,Co as createDecStatusReport,P as cursorBackward,A as cursorBackwardTab,L as cursorDown,f as cursorForward,y as cursorHide,x as cursorHorizontalAbsolute,O as cursorHorizontalForwardTab,b as cursorLeft,_ as cursorMove,q as cursorNextLine,I as cursorPosition,Po as cursorPositionReport,N as cursorPreviousLine,g as cursorRestore,w as cursorSave,h as cursorShow,v as cursorTo,U as cursorToColumn1,B as cursorUp,K as cursorVerticalAbsolute,et as decsin,rt as decswt,ct as deiconifyWindow,Xr as deleteCharacter,Hr as deleteLine,Ao as deviceStatusReport,Mr as disableAnyEventMouse,lr as disableButtonEventMouse,pr as disableFocusTracking,mr as disableNormalMouse,Dr as disableSgrMouse,Tr as disableX10Mouse,Er as enableAnyEventMouse,Cr as enableButtonEventMouse,Pr as enableFocusTracking,Ar as enableNormalMouse,Lr as enableSgrMouse,fr as enableX10Mouse,yr as encodeMouseButtonByte,W as eraseCharacter,k as eraseDisplay,X as eraseDown,H as eraseInLine,Q as eraseLine,V as eraseLineEnd,Y as eraseLineStart,G as eraseLines,j as eraseScreen,J as eraseScreenAndScrollback,Z as eraseUp,Lo as extendedCursorPositionReport,ee as hyperlink,se as iTerm2,St as iconifyWindow,oe as image,Qr as insertCharacter,Vr as insertLine,or as isModeNotRecognized,tr as isModePermanentlyReset,sr as isModePermanentlySet,ir as isModeReset,ar as isModeSet,Wt as it2Cells,Ft as it2Percent,zt as it2Pixels,qt as keyModifierOptions,Rt as lowerWindow,Mt as maximizeWindow,xr as mouseSgrSequence,Or as mouseX10Sequence,lt as moveWindow,It as queryKeyModifierOptions,Nt as queryModifyOtherKeys,pt as raiseWindow,mt as refreshWindow,Yr as repeatPreviousCharacter,fo as reportKeyboardLanguageDEC,nr as reportMode,yo as reportPrimaryDeviceAttributes,xo as reportPrinterNoPaperDEC,Oo as reportPrinterNotReadyDEC,bo as reportPrinterReadyDEC,_o as reportSecondaryDeviceAttributes,qo as reportTerminalNotOK,Io as reportTerminalOK,No as reportTertiaryDeviceAttributes,go as reportUDKLockedDEC,wo as reportUDKUnlockedDEC,Dt as reportWindowPosition,Tt as reportWindowState,Et as requestCellSizePixels,ho as requestCursorPositionReport,vo as requestExtendedCursorPositionReport,Uo as requestKeyboardLanguageDEC,dr as requestMode,Gr as requestPresentationStateReport,Bo as requestPrimaryDeviceAttributes,Ko as requestPrimaryDeviceAttributesParam0,Wo as requestPrinterStatusDEC,Fo as requestSecondaryDeviceAttributes,zo as requestSecondaryDeviceAttributesParam0,Jo as requestTermcap,ko as requestTerminalStatus,Zo as requestTerminfo,Xo as requestTertiaryDeviceAttributes,Ho as requestTertiaryDeviceAttributesParam0,Ct as requestTextAreaSizeChars,Pt as requestTextAreaSizePixels,Qo as requestUDKStatusDEC,gt as resetKeyModifierOptions,ur as resetMode,wt as resetModifyOtherKeys,wr as resetProgressBar,S as resetTerminal,At as resizeTextAreaChars,Lt as resizeTextAreaPixels,ft as restoreMaximizedWindow,Ir as screenPassthrough,ro as scrollDown,oo as scrollUp,F as setCursorStyle,hr as setErrorProgressBar,ot as setIconName,tt as setIconNameAndWindowTitle,st as setIconNameAndWindowTitleWithST,it as setIconNameWithST,vr as setIndeterminateProgressBar,ht as setKeyModifierOptions,jr as setLeftRightMargins,cr as setMode,vt as setModifyOtherKeys1,Ut as setModifyOtherKeys2,yt as setPageSizeLines,Ur as setProgressBar,Jr as setTopBottomMargins,Br as setWarningProgressBar,at as setWindowTitle,nt as setWindowTitleWithST,Yo as strip,Nr as tmuxPassthrough,xt as xtermWindowOp};
1
+ import{ALT_SCREEN_OFF as t,ALT_SCREEN_ON as s,alternativeScreenOff as i,alternativeScreenOn as a}from"./alternative-screen.js";import{clearLineAndHomeCursor as d,clearScreenAndHomeCursor as u,clearScreenFromTopLeft as c,resetTerminal as S}from"./clear.js";import{clearClipboard as M,requestClipboard as p,setClipboard as l}from"./clipboard.js";import{APC as C,BEL as D,CSI as E,DCS as T,ESC as y,OSC as P,PM as b,SEP as A,SOS as L,ST as f}from"./constants.js";import{C as O,a as _,b as q,c as I,R as K,d as g,e as N,S as h,f as w,g as v,h as U,i as B,j as W,k as F,l as z,m as k,n as X,o as H,p as Q,q as V,r as Y,s as G,t as j,u as J,v as Z,w as $,x as ee,y as re,z as oe}from"./packem_shared/cursor-BXG1O_IE.js";import{eraseDisplay as se,eraseDown as ie,eraseInLine as ae,eraseLine as ne,eraseLineEnd as de,eraseLineStart as ue,eraseLines as ce,eraseScreen as Se,eraseScreenAndScrollback as Re,eraseUp as Me}from"./erase.js";import{default as le}from"./hyperlink.js";import{image as Ce}from"./image.js";import{iTerm2 as Ee}from"./iterm2.js";import{BDSM as ye,BiDirectionalSupportMode as Pe,BracketedPasteMode as be,DECRPM as Ae,DECRQM as Le,DisableModifiersMode as fe,IRM as xe,InBandResizeMode as Oe,InsertReplaceMode as _e,KAM as qe,KeyboardActionMode as Ie,LNM as Ke,LightDarkMode as ge,LineFeedNewLineMode as Ne,LocalEchoMode as he,OriginMode as we,RM as ve,RequestBiDirectionalSupportMode as Ue,RequestInBandResizeMode as Be,RequestInsertReplaceMode as We,RequestKeyboardActionMode as Fe,RequestLineFeedNewLineMode as ze,RequestLocalEchoMode as ke,RequestSendReceiveMode as Xe,RequestUnicodeCoreMode as He,ResetBiDirectionalSupportMode as Qe,ResetInBandResizeMode as Ve,ResetInsertReplaceMode as Ye,ResetKeyboardActionMode as Ge,ResetLineFeedNewLineMode as je,ResetLocalEchoMode as Je,ResetSendReceiveMode as Ze,ResetUnicodeCoreMode as $e,SGRMouseMode as er,SM as rr,SRM as or,SendFocusEventsMode as tr,SendReceiveMode as sr,SetBiDirectionalSupportMode as ir,SetInBandResizeMode as ar,SetInsertReplaceMode as nr,SetKeyboardActionMode as dr,SetLineFeedNewLineMode as ur,SetLocalEchoMode as cr,SetSendReceiveMode as Sr,SetUnicodeCoreMode as Rr,TextCursorEnableMode as Mr,UnicodeCoreMode as pr,createAnsiMode as lr,createDecMode as mr,isModeNotRecognized as Cr,isModePermanentlyReset as Dr,isModePermanentlySet as Er,isModeReset as Tr,isModeSet as yr,reportMode as Pr,requestMode as br,resetMode as Ar,setMode as Lr}from"./mode.js";import{MouseButton as xr,disableAnyEventMouse as Or,disableButtonEventMouse as _r,disableFocusTracking as qr,disableNormalMouse as Ir,disableSgrMouse as Kr,disableX10Mouse as gr,enableAnyEventMouse as Nr,enableButtonEventMouse as hr,enableFocusTracking as wr,enableNormalMouse as vr,enableSgrMouse as Ur,enableX10Mouse as Br,encodeMouseButtonByte as Wr,mouseSgrSequence as Fr,mouseX10Sequence as zr}from"./mouse.js";import{SCREEN_MAX_LEN_DEFAULT as Xr,SCREEN_TYPICAL_LIMIT as Hr,screenPassthrough as Qr,tmuxPassthrough as Vr}from"./passthrough.js";import{resetProgressBar as Gr,setErrorProgressBar as jr,setIndeterminateProgressBar as Jr,setProgressBar as Zr,setWarningProgressBar as $r}from"./progress.js";import{RESET_INITIAL_STATE as ro,RIS as oo}from"./reset.js";import{clearTabStop as so,deleteCharacter as io,deleteLine as ao,insertCharacter as no,insertLine as uo,repeatPreviousCharacter as co,requestPresentationStateReport as So,setLeftRightMargins as Ro,setTopBottomMargins as Mo}from"./screen.js";import{SCROLL_DOWN_1 as lo,SCROLL_UP_1 as mo,scrollDown as Co,scrollUp as Do}from"./scroll.js";import{CPR as To,DA1 as yo,DA2 as Po,DA3 as bo,DECXCPR as Ao,DSR as Lo,DSR_KeyboardLanguageDEC as fo,DSR_PrinterStatusDEC as xo,DSR_TerminalStatus as Oo,DSR_UDKStatusDEC as _o,LightDarkReport as qo,RequestLightDarkReport as Io,RequestNameVersion as Ko,XTVERSION as go,createAnsiStatusReport as No,createDecStatusReport as ho,cursorPositionReport as wo,deviceStatusReport as vo,extendedCursorPositionReport as Uo,reportKeyboardLanguageDEC as Bo,reportPrimaryDeviceAttributes as Wo,reportPrinterNoPaperDEC as Fo,reportPrinterNotReadyDEC as zo,reportPrinterReadyDEC as ko,reportSecondaryDeviceAttributes as Xo,reportTerminalNotOK as Ho,reportTerminalOK as Qo,reportTertiaryDeviceAttributes as Vo,reportUDKLockedDEC as Yo,reportUDKUnlockedDEC as Go,requestCursorPositionReport as jo,requestExtendedCursorPositionReport as Jo,requestKeyboardLanguageDEC as Zo,requestPrimaryDeviceAttributes as $o,requestPrimaryDeviceAttributesParam0 as et,requestPrinterStatusDEC as rt,requestSecondaryDeviceAttributes as ot,requestSecondaryDeviceAttributesParam0 as tt,requestTerminalStatus as st,requestTertiaryDeviceAttributes as it,requestTertiaryDeviceAttributesParam0 as at,requestUDKStatusDEC as nt}from"./status.js";import{default as ut}from"./strip.js";import{XTGETTCAP as St,requestTermcap as Rt,requestTerminfo as Mt}from"./termcap.js";import{decsin as lt,decswt as mt,setIconName as Ct,setIconNameAndWindowTitle as Dt,setIconNameAndWindowTitleWithST as Et,setIconNameWithST as Tt,setWindowTitle as yt,setWindowTitleWithST as Pt}from"./title.js";import{XTWINOPS as At,deiconifyWindow as Lt,iconifyWindow as ft,lowerWindow as xt,maximizeWindow as Ot,moveWindow as _t,raiseWindow as qt,refreshWindow as It,reportWindowPosition as Kt,reportWindowState as gt,requestCellSizePixels as Nt,requestTextAreaSizeChars as ht,requestTextAreaSizePixels as wt,resizeTextAreaChars as vt,resizeTextAreaPixels as Ut,restoreMaximizedWindow as Bt,setPageSizeLines as Wt,xtermWindowOp as Ft}from"./window-ops.js";import{KittyKeyboardFlag as kt,XTMODKEYS as Xt,XTQMODKEYS as Ht,keyModifierOptions as Qt,popKittyKeyboard as Vt,pushKittyKeyboard as Yt,queryKeyModifierOptions as Gt,queryKittyKeyboard as jt,queryModifyOtherKeys as Jt,resetKeyModifierOptions as Zt,resetModifyOtherKeys as $t,setKeyModifierOptions as es,setKittyKeyboard as rs,setModifyOtherKeys1 as os,setModifyOtherKeys2 as ts}from"./xterm.js";import{IT2_AUTO as is,it2Cells as as,it2Percent as ns,it2Pixels as ds}from"./packem_shared/IT2_AUTO-K3GubKy7.js";import{ITerm2File as cs,ITerm2FileEnd as Ss,ITerm2FilePart as Rs,ITerm2MultipartFileStart as Ms}from"./packem_shared/ITerm2File-BkLc5ipB.js";const e="\x07";export{t as ALT_SCREEN_OFF,s as ALT_SCREEN_ON,C as APC,ye as BDSM,D as BEL,Pe as BiDirectionalSupportMode,be as BracketedPasteMode,To as CPR,E as CSI,O as CURSOR_BACKWARD_1,_ as CURSOR_DOWN_1,q as CURSOR_FORWARD_1,I as CURSOR_UP_1,yo as DA1,Po as DA2,bo as DA3,T as DCS,Ae as DECRPM,Le as DECRQM,Ao as DECXCPR,Lo as DSR,fo as DSR_KeyboardLanguageDEC,xo as DSR_PrinterStatusDEC,Oo as DSR_TerminalStatus,_o as DSR_UDKStatusDEC,fe as DisableModifiersMode,y as ESC,xe as IRM,is as IT2_AUTO,cs as ITerm2File,Ss as ITerm2FileEnd,Rs as ITerm2FilePart,Ms as ITerm2MultipartFileStart,Oe as InBandResizeMode,_e as InsertReplaceMode,qe as KAM,Ie as KeyboardActionMode,kt as KittyKeyboardFlag,Ke as LNM,ge as LightDarkMode,qo as LightDarkReport,Ne as LineFeedNewLineMode,he as LocalEchoMode,xr as MouseButton,P as OSC,we as OriginMode,b as PM,K as REQUEST_CURSOR_POSITION,g as REQUEST_EXTENDED_CURSOR_POSITION,ro as RESET_INITIAL_STATE,N as RESTORE_CURSOR_DEC,oo as RIS,ve as RM,Ue as RequestBiDirectionalSupportMode,Be as RequestInBandResizeMode,We as RequestInsertReplaceMode,Fe as RequestKeyboardActionMode,Io as RequestLightDarkReport,ze as RequestLineFeedNewLineMode,ke as RequestLocalEchoMode,Ko as RequestNameVersion,Xe as RequestSendReceiveMode,He as RequestUnicodeCoreMode,Qe as ResetBiDirectionalSupportMode,Ve as ResetInBandResizeMode,Ye as ResetInsertReplaceMode,Ge as ResetKeyboardActionMode,je as ResetLineFeedNewLineMode,Je as ResetLocalEchoMode,Ze as ResetSendReceiveMode,$e as ResetUnicodeCoreMode,h as SAVE_CURSOR_DEC,Xr as SCREEN_MAX_LEN_DEFAULT,Hr as SCREEN_TYPICAL_LIMIT,lo as SCROLL_DOWN_1,mo as SCROLL_UP_1,A as SEP,er as SGRMouseMode,rr as SM,L as SOS,or as SRM,f as ST,tr as SendFocusEventsMode,sr as SendReceiveMode,ir as SetBiDirectionalSupportMode,ar as SetInBandResizeMode,nr as SetInsertReplaceMode,dr as SetKeyboardActionMode,ur as SetLineFeedNewLineMode,cr as SetLocalEchoMode,Sr as SetSendReceiveMode,Rr as SetUnicodeCoreMode,Mr as TextCursorEnableMode,pr as UnicodeCoreMode,St as XTGETTCAP,Xt as XTMODKEYS,Ht as XTQMODKEYS,go as XTVERSION,At as XTWINOPS,i as alternativeScreenOff,a as alternativeScreenOn,e as beep,M as clearClipboard,d as clearLineAndHomeCursor,u as clearScreenAndHomeCursor,c as clearScreenFromTopLeft,so as clearTabStop,lr as createAnsiMode,No as createAnsiStatusReport,mr as createDecMode,ho as createDecStatusReport,w as cursorBackward,v as cursorBackwardTab,U as cursorDown,B as cursorForward,W as cursorHide,F as cursorHorizontalAbsolute,z as cursorHorizontalForwardTab,k as cursorLeft,X as cursorMove,H as cursorNextLine,Q as cursorPosition,wo as cursorPositionReport,V as cursorPreviousLine,Y as cursorRestore,G as cursorSave,j as cursorShow,J as cursorTo,Z as cursorToColumn1,$ as cursorUp,ee as cursorVerticalAbsolute,lt as decsin,mt as decswt,Lt as deiconifyWindow,io as deleteCharacter,ao as deleteLine,vo as deviceStatusReport,Or as disableAnyEventMouse,_r as disableButtonEventMouse,qr as disableFocusTracking,Ir as disableNormalMouse,Kr as disableSgrMouse,gr as disableX10Mouse,Nr as enableAnyEventMouse,hr as enableButtonEventMouse,wr as enableFocusTracking,vr as enableNormalMouse,Ur as enableSgrMouse,Br as enableX10Mouse,Wr as encodeMouseButtonByte,re as eraseCharacter,se as eraseDisplay,ie as eraseDown,ae as eraseInLine,ne as eraseLine,de as eraseLineEnd,ue as eraseLineStart,ce as eraseLines,Se as eraseScreen,Re as eraseScreenAndScrollback,Me as eraseUp,Uo as extendedCursorPositionReport,le as hyperlink,Ee as iTerm2,ft as iconifyWindow,Ce as image,no as insertCharacter,uo as insertLine,Cr as isModeNotRecognized,Dr as isModePermanentlyReset,Er as isModePermanentlySet,Tr as isModeReset,yr as isModeSet,as as it2Cells,ns as it2Percent,ds as it2Pixels,Qt as keyModifierOptions,xt as lowerWindow,Ot as maximizeWindow,Fr as mouseSgrSequence,zr as mouseX10Sequence,_t as moveWindow,Vt as popKittyKeyboard,Yt as pushKittyKeyboard,Gt as queryKeyModifierOptions,jt as queryKittyKeyboard,Jt as queryModifyOtherKeys,qt as raiseWindow,It as refreshWindow,co as repeatPreviousCharacter,Bo as reportKeyboardLanguageDEC,Pr as reportMode,Wo as reportPrimaryDeviceAttributes,Fo as reportPrinterNoPaperDEC,zo as reportPrinterNotReadyDEC,ko as reportPrinterReadyDEC,Xo as reportSecondaryDeviceAttributes,Ho as reportTerminalNotOK,Qo as reportTerminalOK,Vo as reportTertiaryDeviceAttributes,Yo as reportUDKLockedDEC,Go as reportUDKUnlockedDEC,Kt as reportWindowPosition,gt as reportWindowState,Nt as requestCellSizePixels,p as requestClipboard,jo as requestCursorPositionReport,Jo as requestExtendedCursorPositionReport,Zo as requestKeyboardLanguageDEC,br as requestMode,So as requestPresentationStateReport,$o as requestPrimaryDeviceAttributes,et as requestPrimaryDeviceAttributesParam0,rt as requestPrinterStatusDEC,ot as requestSecondaryDeviceAttributes,tt as requestSecondaryDeviceAttributesParam0,Rt as requestTermcap,st as requestTerminalStatus,Mt as requestTerminfo,it as requestTertiaryDeviceAttributes,at as requestTertiaryDeviceAttributesParam0,ht as requestTextAreaSizeChars,wt as requestTextAreaSizePixels,nt as requestUDKStatusDEC,Zt as resetKeyModifierOptions,Ar as resetMode,$t as resetModifyOtherKeys,Gr as resetProgressBar,S as resetTerminal,vt as resizeTextAreaChars,Ut as resizeTextAreaPixels,Bt as restoreMaximizedWindow,Qr as screenPassthrough,Co as scrollDown,Do as scrollUp,l as setClipboard,oe as setCursorStyle,jr as setErrorProgressBar,Ct as setIconName,Dt as setIconNameAndWindowTitle,Et as setIconNameAndWindowTitleWithST,Tt as setIconNameWithST,Jr as setIndeterminateProgressBar,es as setKeyModifierOptions,rs as setKittyKeyboard,Ro as setLeftRightMargins,Lr as setMode,os as setModifyOtherKeys1,ts as setModifyOtherKeys2,Wt as setPageSizeLines,Zr as setProgressBar,Mo as setTopBottomMargins,$r as setWarningProgressBar,yt as setWindowTitle,Pt as setWindowTitleWithST,ut as strip,Vr as tmuxPassthrough,Ft as xtermWindowOp};
package/dist/iterm2.js CHANGED
@@ -1 +1 @@
1
- var i=Object.defineProperty;var r=(t,e)=>i(t,"name",{value:e,configurable:!0});import{O as o,B as m}from"./packem_shared/constants-D12jy2Zh.js";import{IT2_AUTO as u,it2Cells as c,it2Percent as d,it2Pixels as f}from"./packem_shared/IT2_AUTO-OiB8EaxU.js";import{ITerm2File as g,ITerm2FileEnd as O,ITerm2FilePart as P,ITerm2MultipartFileStart as v}from"./packem_shared/ITerm2File-XoC8RMzs.js";var a=Object.defineProperty,l=r((t,e)=>a(t,"name",{value:e,configurable:!0}),"e");const T=l(t=>{if(t.toString===Object.prototype.toString)throw new Error("Invalid payload: must implement IITerm2Payload with a custom toString method");return`${o}1337;${t.toString()}${m}`},"iTerm2");export{u as IT2_AUTO,g as ITerm2File,O as ITerm2FileEnd,P as ITerm2FilePart,v as ITerm2MultipartFileStart,T as iTerm2,c as it2Cells,d as it2Percent,f as it2Pixels};
1
+ import{OSC as r,BEL as e}from"./constants.js";import{IT2_AUTO as n,it2Cells as a,it2Percent as p,it2Pixels as I}from"./packem_shared/IT2_AUTO-K3GubKy7.js";import{ITerm2File as S,ITerm2FileEnd as d,ITerm2FilePart as s,ITerm2MultipartFileStart as c}from"./packem_shared/ITerm2File-BkLc5ipB.js";const i=t=>{if(t.toString===Object.prototype.toString)throw new Error("Invalid payload: must implement IITerm2Payload with a custom toString method");return`${r}1337;${t.toString()}${e}`};export{n as IT2_AUTO,S as ITerm2File,d as ITerm2FileEnd,s as ITerm2FilePart,c as ITerm2MultipartFileStart,i as iTerm2,a as it2Cells,p as it2Percent,I as it2Pixels};
package/dist/mode.js CHANGED
@@ -1 +1 @@
1
- var S=Object.defineProperty;var u=(o,M)=>S(o,"name",{value:M,configurable:!0});import{C as e}from"./packem_shared/constants-D12jy2Zh.js";var p=Object.defineProperty,d=u((o,M)=>p(o,"name",{value:M,configurable:!0}),"s");class h{static{u(this,"g")}static{d(this,"AnsiModeImpl")}code;isDecMode=!1;constructor(M){this.code=M}}class g{static{u(this,"u")}static{d(this,"DecModeImpl")}code;isDecMode=!0;constructor(M){this.code=M}}const R=d((o,...M)=>{if(M.length===0)return"";const r=o?"l":"h";if(M.length===1){const s=M[0];let l=e;return s.isDecMode&&(l+="?"),l+String(s.code)+r}const i=M.filter(s=>!s.isDecMode).map(s=>s.code),a=M.filter(s=>s.isDecMode).map(s=>s.code);let $="";return i.length>0&&($+=`${e}${i.join(";")}${r}`),a.length>0&&($+=`${e}?${a.join(";")}${r}`),$},"generateModeSequence");var E=(o=>(o[o.NotRecognized=0]="NotRecognized",o[o.Set=1]="Set",o[o.Reset=2]="Reset",o[o.PermanentlySet=3]="PermanentlySet",o[o.PermanentlyReset=4]="PermanentlyReset",o))(E||{});const Q=d(o=>o===0,"isModeNotRecognized"),J=d(o=>o===1||o===3,"isModeSet"),V=d(o=>o===2||o===4,"isModeReset"),Y=d(o=>o===3,"isModePermanentlySet"),Z=d(o=>o===4,"isModePermanentlyReset"),n=d(o=>new h(o),"createAnsiMode"),t=d(o=>new g(o),"createDecMode"),C=d((...o)=>R(!1,...o),"setMode"),_=C,q=d((...o)=>R(!0,...o),"resetMode"),ee=q,y=d(o=>{let M=e;return o.isDecMode&&(M+="?"),`${M}${String(o.code)}$p`},"requestMode"),oe=y,v=d((o,M)=>{let r=M;(M<0||M>4)&&(r=0);let i=e;return o.isDecMode&&(i+="?"),`${i}${String(o.code)};${String(r)}$y`},"reportMode"),te=v,D=n(2),Me=D,de=`${e}2h`,se=`${e}2l`,re=`${e}2$p`,x=n(4),ie=x,ne=`${e}4h`,ue=`${e}4l`,$e=`${e}4$p`,m=n(8),ae=m,le=`${e}8h`,Re=`${e}8l`,ce=`${e}8$p`,c=n(12),Se=c,pe=c,A=`${e}12h`,B=`${e}12l`,L=`${e}12$p`,he=A,ge=B,Ee=L,f=n(20),Ce=f,qe=`${e}20h`,ye=`${e}20l`,ve=`${e}20$p`,K=t(1),De=K,xe=`${e}?1h`,me=`${e}?1l`,Ae=`${e}?1$p`,N=t(6),Be=N,Le=`${e}?6h`,fe=`${e}?6l`,Ke=`${e}?6$p`,P=t(7),Ne=P,Pe=`${e}?7h`,Ie=`${e}?7l`,be=`${e}?7$p`,ke=t(9),ze=`${e}?9h`,Ue=`${e}?9l`,we=`${e}?9$p`,I=t(25),Oe=I,b=`${e}?25h`,k=`${e}?25l`,Fe=`${e}?25$p`,We=b,Ge=k,z=t(66),He=z,Te=`${e}?66h`,Xe=`${e}?66l`,je=`${e}?66$p`,U=t(67),Qe=U,Je=`${e}?67h`,Ve=`${e}?67l`,Ye=`${e}?67$p`,w=t(69),Ze=w,_e=`${e}?69h`,eo=`${e}?69l`,oo=`${e}?69$p`,to=t(1e3),Mo=`${e}?1000h`,so=`${e}?1000l`,ro=`${e}?1000$p`,io=t(1001),no=`${e}?1001h`,uo=`${e}?1001l`,$o=`${e}?1001$p`,ao=t(1002),lo=`${e}?1002h`,Ro=`${e}?1002l`,co=`${e}?1002$p`,So=t(1003),po=`${e}?1003h`,ho=`${e}?1003l`,go=`${e}?1003$p`,O=t(1004),Eo=`${e}?1004h`,Co=`${e}?1004l`,qo=`${e}?1004$p`,yo=t(1005),vo=`${e}?1005h`,Do=`${e}?1005l`,xo=`${e}?1005$p`,F=t(1006),mo=`${e}?1006h`,Ao=`${e}?1006l`,Bo=`${e}?1006$p`,Lo=t(1015),fo=`${e}?1015h`,Ko=`${e}?1015l`,No=`${e}?1015$p`,Po=t(1016),Io=`${e}?1016h`,bo=`${e}?1016l`,ko=`${e}?1016$p`,zo=F,Uo=O,wo=t(1035),Oo=`${e}?1035h`,Fo=`${e}?1035l`,Wo=`${e}?1035$p`,Go=t(1047),Ho=`${e}?1047h`,To=`${e}?1047l`,Xo=`${e}?1047$p`,jo=t(1048),Qo=`${e}?1048h`,Jo=`${e}?1048l`,Vo=`${e}?1048$p`,Yo=t(1049),Zo=`${e}?1049h`,_o=`${e}?1049l`,et=`${e}?1049$p`,ot=t(2004),tt=`${e}?2004h`,Mt=`${e}?2004l`,dt=`${e}?2004$p`,st=t(2026),rt=`${e}?2026h`,it=`${e}?2026l`,nt=`${e}?2026$p`,W=t(2027),G=`${e}?2027h`,H=`${e}?2027l`,T=`${e}?2027$p`,ut=W,$t=G,at=H,lt=T,Rt=t(9001),ct=`${e}?9001h`,St=`${e}?9001l`,pt=`${e}?9001$p`,ht=t(2031),gt=`${e}?2031h`,Et=`${e}?2031l`,Ct=`${e}?2031$p`,qt=t(2048),yt=`${e}?2048h`,vt=`${e}?2048l`,Dt=`${e}?2048$p`;export{Go as AltScreenMode,Yo as AltScreenSaveCursorMode,So as AnyEventMouseMode,P as AutoWrapMode,ae as BDSM,U as BackarrowKeyMode,m as BiDirectionalSupportMode,ot as BracketedPasteMode,ao as ButtonEventMouseMode,K as CursorKeysMode,Ne as DECAWM,Qe as DECBKM,De as DECCKM,Ze as DECLRMM,He as DECNKM,Be as DECOM,te as DECRPM,oe as DECRQM,Oe as DECTCEM,wo as DisableModifiersMode,O as FocusEventMode,ut as GraphemeClusteringMode,Ge as HideCursor,io as HighlightMouseMode,ie as IRM,qt as InBandResizeMode,x as InsertReplaceMode,Me as KAM,D as KeyboardActionMode,Ce as LNM,w as LeftRightMarginMode,ht as LightDarkMode,f as LineFeedNewLineMode,Se as LocalEchoMode,E as ModeSetting,to as NormalMouseMode,z as NumericKeypadMode,N as OriginMode,ee as RM,Xo as RequestAltScreenMode,et as RequestAltScreenSaveCursorMode,go as RequestAnyEventMouseMode,be as RequestAutoWrapMode,Ye as RequestBackarrowKeyMode,ce as RequestBiDirectionalSupportMode,dt as RequestBracketedPasteMode,co as RequestButtonEventMouseMode,Ae as RequestCursorKeysMode,Wo as RequestDisableModifiersMode,qo as RequestFocusEventMode,lt as RequestGraphemeClusteringMode,$o as RequestHighlightMouseMode,Dt as RequestInBandResizeMode,$e as RequestInsertReplaceMode,re as RequestKeyboardActionMode,oo as RequestLeftRightMarginMode,Ct as RequestLightDarkMode,ve as RequestLineFeedNewLineMode,Ee as RequestLocalEchoMode,ro as RequestNormalMouseMode,je as RequestNumericKeypadMode,Ke as RequestOriginMode,Vo as RequestSaveCursorMode,L as RequestSendReceiveMode,Bo as RequestSgrExtMouseMode,ko as RequestSgrPixelExtMouseMode,nt as RequestSynchronizedOutputMode,Fe as RequestTextCursorEnableMode,T as RequestUnicodeCoreMode,No as RequestUrxvtExtMouseMode,xo as RequestUtf8ExtMouseMode,pt as RequestWin32InputMode,we as RequestX10MouseMode,To as ResetAltScreenMode,_o as ResetAltScreenSaveCursorMode,ho as ResetAnyEventMouseMode,Ie as ResetAutoWrapMode,Ve as ResetBackarrowKeyMode,Re as ResetBiDirectionalSupportMode,Mt as ResetBracketedPasteMode,Ro as ResetButtonEventMouseMode,me as ResetCursorKeysMode,Fo as ResetDisableModifiersMode,Co as ResetFocusEventMode,at as ResetGraphemeClusteringMode,uo as ResetHighlightMouseMode,vt as ResetInBandResizeMode,ue as ResetInsertReplaceMode,se as ResetKeyboardActionMode,eo as ResetLeftRightMarginMode,Et as ResetLightDarkMode,ye as ResetLineFeedNewLineMode,ge as ResetLocalEchoMode,so as ResetNormalMouseMode,Xe as ResetNumericKeypadMode,fe as ResetOriginMode,Jo as ResetSaveCursorMode,B as ResetSendReceiveMode,Ao as ResetSgrExtMouseMode,bo as ResetSgrPixelExtMouseMode,it as ResetSynchronizedOutputMode,k as ResetTextCursorEnableMode,H as ResetUnicodeCoreMode,Ko as ResetUrxvtExtMouseMode,Do as ResetUtf8ExtMouseMode,St as ResetWin32InputMode,Ue as ResetX10MouseMode,zo as SGRMouseMode,_ as SM,pe as SRM,jo as SaveCursorMode,Uo as SendFocusEventsMode,c as SendReceiveMode,Ho as SetAltScreenMode,Zo as SetAltScreenSaveCursorMode,po as SetAnyEventMouseMode,Pe as SetAutoWrapMode,Je as SetBackarrowKeyMode,le as SetBiDirectionalSupportMode,tt as SetBracketedPasteMode,lo as SetButtonEventMouseMode,xe as SetCursorKeysMode,Oo as SetDisableModifiersMode,Eo as SetFocusEventMode,$t as SetGraphemeClusteringMode,no as SetHighlightMouseMode,yt as SetInBandResizeMode,ne as SetInsertReplaceMode,de as SetKeyboardActionMode,_e as SetLeftRightMarginMode,gt as SetLightDarkMode,qe as SetLineFeedNewLineMode,he as SetLocalEchoMode,Mo as SetNormalMouseMode,Te as SetNumericKeypadMode,Le as SetOriginMode,Qo as SetSaveCursorMode,A as SetSendReceiveMode,mo as SetSgrExtMouseMode,Io as SetSgrPixelExtMouseMode,rt as SetSynchronizedOutputMode,b as SetTextCursorEnableMode,G as SetUnicodeCoreMode,fo as SetUrxvtExtMouseMode,vo as SetUtf8ExtMouseMode,ct as SetWin32InputMode,ze as SetX10MouseMode,F as SgrExtMouseMode,Po as SgrPixelExtMouseMode,We as ShowCursor,st as SynchronizedOutputMode,I as TextCursorEnableMode,W as UnicodeCoreMode,Lo as UrxvtExtMouseMode,yo as Utf8ExtMouseMode,Rt as Win32InputMode,ke as X10MouseMode,n as createAnsiMode,t as createDecMode,Q as isModeNotRecognized,Z as isModePermanentlyReset,Y as isModePermanentlySet,V as isModeReset,J as isModeSet,v as reportMode,y as requestMode,q as resetMode,C as setMode};
1
+ import{CSI as e}from"./constants.js";class a{code;isDecMode=!1;constructor(M){this.code=M}}class c{code;isDecMode=!0;constructor(M){this.code=M}}const R=(o,...M)=>{if(M.length===0)return"";const s=o?"l":"h";if(M.length===1){const d=M[0];let i=e;return d.isDecMode&&(i+="?"),i+String(d.code)+s}const r=M.filter(d=>!d.isDecMode).map(d=>d.code),u=M.filter(d=>d.isDecMode).map(d=>d.code);let n="";return r.length>0&&(n+=`${e}${r.join(";")}${s}`),u.length>0&&(n+=`${e}?${u.join(";")}${s}`),n};var S=(o=>(o[o.NotRecognized=0]="NotRecognized",o[o.Set=1]="Set",o[o.Reset=2]="Reset",o[o.PermanentlySet=3]="PermanentlySet",o[o.PermanentlyReset=4]="PermanentlyReset",o))(S||{});const G=o=>o===0,H=o=>o===1||o===3,T=o=>o===2||o===4,X=o=>o===3,j=o=>o===4,$=o=>new a(o),t=o=>new c(o),p=(...o)=>R(!1,...o),Q=p,h=(...o)=>R(!0,...o),J=h,g=o=>{let M=e;return o.isDecMode&&(M+="?"),`${M}${String(o.code)}$p`},V=g,E=(o,M)=>{let s=M;(M<0||M>4)&&(s=0);let r=e;return o.isDecMode&&(r+="?"),`${r}${String(o.code)};${String(s)}$y`},Y=E,C=$(2),Z=C,_=`${e}2h`,ee=`${e}2l`,oe=`${e}2$p`,q=$(4),te=q,Me=`${e}4h`,de=`${e}4l`,se=`${e}4$p`,y=$(8),re=y,$e=`${e}8h`,ne=`${e}8l`,ue=`${e}8$p`,l=$(12),ie=l,Re=l,v=`${e}12h`,x=`${e}12l`,D=`${e}12$p`,le=v,ae=x,ce=D,A=$(20),Se=A,pe=`${e}20h`,he=`${e}20l`,ge=`${e}20$p`,m=t(1),Ee=m,Ce=`${e}?1h`,qe=`${e}?1l`,ye=`${e}?1$p`,B=t(6),ve=B,xe=`${e}?6h`,De=`${e}?6l`,Ae=`${e}?6$p`,L=t(7),me=L,Be=`${e}?7h`,Le=`${e}?7l`,Ke=`${e}?7$p`,fe=t(9),Ne=`${e}?9h`,Pe=`${e}?9l`,Ie=`${e}?9$p`,K=t(25),be=K,f=`${e}?25h`,N=`${e}?25l`,ke=`${e}?25$p`,Ue=f,we=N,P=t(66),ze=P,Fe=`${e}?66h`,Oe=`${e}?66l`,We=`${e}?66$p`,I=t(67),Ge=I,He=`${e}?67h`,Te=`${e}?67l`,Xe=`${e}?67$p`,b=t(69),je=b,Qe=`${e}?69h`,Je=`${e}?69l`,Ve=`${e}?69$p`,Ye=t(1e3),Ze=`${e}?1000h`,_e=`${e}?1000l`,eo=`${e}?1000$p`,oo=t(1001),to=`${e}?1001h`,Mo=`${e}?1001l`,so=`${e}?1001$p`,ro=t(1002),$o=`${e}?1002h`,no=`${e}?1002l`,uo=`${e}?1002$p`,io=t(1003),Ro=`${e}?1003h`,lo=`${e}?1003l`,ao=`${e}?1003$p`,k=t(1004),co=`${e}?1004h`,So=`${e}?1004l`,po=`${e}?1004$p`,ho=t(1005),go=`${e}?1005h`,Eo=`${e}?1005l`,Co=`${e}?1005$p`,U=t(1006),qo=`${e}?1006h`,yo=`${e}?1006l`,vo=`${e}?1006$p`,xo=t(1015),Do=`${e}?1015h`,Ao=`${e}?1015l`,mo=`${e}?1015$p`,Bo=t(1016),Lo=`${e}?1016h`,Ko=`${e}?1016l`,fo=`${e}?1016$p`,No=U,Po=k,Io=t(1035),bo=`${e}?1035h`,ko=`${e}?1035l`,Uo=`${e}?1035$p`,wo=t(1047),zo=`${e}?1047h`,Fo=`${e}?1047l`,Oo=`${e}?1047$p`,Wo=t(1048),Go=`${e}?1048h`,Ho=`${e}?1048l`,To=`${e}?1048$p`,Xo=t(1049),jo=`${e}?1049h`,Qo=`${e}?1049l`,Jo=`${e}?1049$p`,Vo=t(2004),Yo=`${e}?2004h`,Zo=`${e}?2004l`,_o=`${e}?2004$p`,et=t(2026),ot=`${e}?2026h`,tt=`${e}?2026l`,Mt=`${e}?2026$p`,w=t(2027),z=`${e}?2027h`,F=`${e}?2027l`,O=`${e}?2027$p`,dt=w,st=z,rt=F,$t=O,nt=t(9001),ut=`${e}?9001h`,it=`${e}?9001l`,Rt=`${e}?9001$p`,lt=t(2031),at=`${e}?2031h`,ct=`${e}?2031l`,St=`${e}?2031$p`,pt=t(2048),ht=`${e}?2048h`,gt=`${e}?2048l`,Et=`${e}?2048$p`;export{wo as AltScreenMode,Xo as AltScreenSaveCursorMode,io as AnyEventMouseMode,L as AutoWrapMode,re as BDSM,I as BackarrowKeyMode,y as BiDirectionalSupportMode,Vo as BracketedPasteMode,ro as ButtonEventMouseMode,m as CursorKeysMode,me as DECAWM,Ge as DECBKM,Ee as DECCKM,je as DECLRMM,ze as DECNKM,ve as DECOM,Y as DECRPM,V as DECRQM,be as DECTCEM,Io as DisableModifiersMode,k as FocusEventMode,dt as GraphemeClusteringMode,we as HideCursor,oo as HighlightMouseMode,te as IRM,pt as InBandResizeMode,q as InsertReplaceMode,Z as KAM,C as KeyboardActionMode,Se as LNM,b as LeftRightMarginMode,lt as LightDarkMode,A as LineFeedNewLineMode,ie as LocalEchoMode,S as ModeSetting,Ye as NormalMouseMode,P as NumericKeypadMode,B as OriginMode,J as RM,Oo as RequestAltScreenMode,Jo as RequestAltScreenSaveCursorMode,ao as RequestAnyEventMouseMode,Ke as RequestAutoWrapMode,Xe as RequestBackarrowKeyMode,ue as RequestBiDirectionalSupportMode,_o as RequestBracketedPasteMode,uo as RequestButtonEventMouseMode,ye as RequestCursorKeysMode,Uo as RequestDisableModifiersMode,po as RequestFocusEventMode,$t as RequestGraphemeClusteringMode,so as RequestHighlightMouseMode,Et as RequestInBandResizeMode,se as RequestInsertReplaceMode,oe as RequestKeyboardActionMode,Ve as RequestLeftRightMarginMode,St as RequestLightDarkMode,ge as RequestLineFeedNewLineMode,ce as RequestLocalEchoMode,eo as RequestNormalMouseMode,We as RequestNumericKeypadMode,Ae as RequestOriginMode,To as RequestSaveCursorMode,D as RequestSendReceiveMode,vo as RequestSgrExtMouseMode,fo as RequestSgrPixelExtMouseMode,Mt as RequestSynchronizedOutputMode,ke as RequestTextCursorEnableMode,O as RequestUnicodeCoreMode,mo as RequestUrxvtExtMouseMode,Co as RequestUtf8ExtMouseMode,Rt as RequestWin32InputMode,Ie as RequestX10MouseMode,Fo as ResetAltScreenMode,Qo as ResetAltScreenSaveCursorMode,lo as ResetAnyEventMouseMode,Le as ResetAutoWrapMode,Te as ResetBackarrowKeyMode,ne as ResetBiDirectionalSupportMode,Zo as ResetBracketedPasteMode,no as ResetButtonEventMouseMode,qe as ResetCursorKeysMode,ko as ResetDisableModifiersMode,So as ResetFocusEventMode,rt as ResetGraphemeClusteringMode,Mo as ResetHighlightMouseMode,gt as ResetInBandResizeMode,de as ResetInsertReplaceMode,ee as ResetKeyboardActionMode,Je as ResetLeftRightMarginMode,ct as ResetLightDarkMode,he as ResetLineFeedNewLineMode,ae as ResetLocalEchoMode,_e as ResetNormalMouseMode,Oe as ResetNumericKeypadMode,De as ResetOriginMode,Ho as ResetSaveCursorMode,x as ResetSendReceiveMode,yo as ResetSgrExtMouseMode,Ko as ResetSgrPixelExtMouseMode,tt as ResetSynchronizedOutputMode,N as ResetTextCursorEnableMode,F as ResetUnicodeCoreMode,Ao as ResetUrxvtExtMouseMode,Eo as ResetUtf8ExtMouseMode,it as ResetWin32InputMode,Pe as ResetX10MouseMode,No as SGRMouseMode,Q as SM,Re as SRM,Wo as SaveCursorMode,Po as SendFocusEventsMode,l as SendReceiveMode,zo as SetAltScreenMode,jo as SetAltScreenSaveCursorMode,Ro as SetAnyEventMouseMode,Be as SetAutoWrapMode,He as SetBackarrowKeyMode,$e as SetBiDirectionalSupportMode,Yo as SetBracketedPasteMode,$o as SetButtonEventMouseMode,Ce as SetCursorKeysMode,bo as SetDisableModifiersMode,co as SetFocusEventMode,st as SetGraphemeClusteringMode,to as SetHighlightMouseMode,ht as SetInBandResizeMode,Me as SetInsertReplaceMode,_ as SetKeyboardActionMode,Qe as SetLeftRightMarginMode,at as SetLightDarkMode,pe as SetLineFeedNewLineMode,le as SetLocalEchoMode,Ze as SetNormalMouseMode,Fe as SetNumericKeypadMode,xe as SetOriginMode,Go as SetSaveCursorMode,v as SetSendReceiveMode,qo as SetSgrExtMouseMode,Lo as SetSgrPixelExtMouseMode,ot as SetSynchronizedOutputMode,f as SetTextCursorEnableMode,z as SetUnicodeCoreMode,Do as SetUrxvtExtMouseMode,go as SetUtf8ExtMouseMode,ut as SetWin32InputMode,Ne as SetX10MouseMode,U as SgrExtMouseMode,Bo as SgrPixelExtMouseMode,Ue as ShowCursor,et as SynchronizedOutputMode,K as TextCursorEnableMode,w as UnicodeCoreMode,xo as UrxvtExtMouseMode,ho as Utf8ExtMouseMode,nt as Win32InputMode,fe as X10MouseMode,$ as createAnsiMode,t as createDecMode,G as isModeNotRecognized,j as isModePermanentlyReset,X as isModePermanentlySet,T as isModeReset,H as isModeSet,E as reportMode,g as requestMode,h as resetMode,p as setMode};
package/dist/mouse.js CHANGED
@@ -1 +1 @@
1
- var a=Object.defineProperty;var l=(e,u)=>a(e,"name",{value:u,configurable:!0});import{E as o}from"./packem_shared/constants-D12jy2Zh.js";var B=Object.defineProperty,E=l((e,u)=>B(e,"name",{value:u,configurable:!0}),"s");const $=4,_=8,c=16,M=32,N=64,S=128,O=3,T=32,t={BACKWARD:8,BUTTON_1:1,BUTTON_2:2,BUTTON_3:3,BUTTON_4:4,BUTTON_5:5,BUTTON_6:6,BUTTON_7:7,BUTTON_8:8,BUTTON_9:9,BUTTON_10:10,BUTTON_11:11,FORWARD:9,LEFT:1,MIDDLE:2,NONE:0,RELEASE:0,RIGHT:3,WHEEL_DOWN:5,WHEEL_LEFT:6,WHEEL_RIGHT:7,WHEEL_UP:4},L=E((e,u,r={})=>{let n;if(e===t.RELEASE)n=O;else if(e>=t.LEFT&&e<=t.RIGHT)n=e-t.LEFT;else if(e>=t.WHEEL_UP&&e<=t.WHEEL_RIGHT)n=e-t.WHEEL_UP,n|=N;else if(e>=t.BACKWARD&&e<=t.BUTTON_11)n=e-t.BACKWARD,n|=S;else return 255;return r.shift&&(n|=$),r.alt&&(n|=_),r.ctrl&&(n|=c),u&&(n|=M),n},"encodeMouseButtonByte"),f=E((e,u,r)=>{if(e===255)return"";const n=String.fromCodePoint(e+T),s=String.fromCodePoint(u+1+T),i=String.fromCodePoint(r+1+T);return`${o}[M${n}${s}${i}`},"mouseX10Sequence"),g=E((e,u,r,n)=>{if(e===255)return"";const s=n?"m":"M";return`${o}[<${String(e)};${String(u+1)};${String(r+1)}${s}`},"mouseSgrSequence"),m=`${o}[?9h`,d=`${o}[?9l`,W=`${o}[?1000h`,A=`${o}[?1000l`,H=`${o}[?1002h`,R=`${o}[?1002l`,h=`${o}[?1003h`,v=`${o}[?1003l`,C=`${o}[?1006h`,D=`${o}[?1006l`,F=`${o}[?1004h`,P=`${o}[?1004l`;export{t as MouseButton,v as disableAnyEventMouse,R as disableButtonEventMouse,P as disableFocusTracking,A as disableNormalMouse,D as disableSgrMouse,d as disableX10Mouse,h as enableAnyEventMouse,H as enableButtonEventMouse,F as enableFocusTracking,W as enableNormalMouse,C as enableSgrMouse,m as enableX10Mouse,L as encodeMouseButtonByte,g as mouseSgrSequence,f as mouseX10Sequence};
1
+ import{ESC as o}from"./constants.js";const l=4,i=8,B=16,$=32,_=64,a=128,N=3,E=32,t={BACKWARD:8,BUTTON_1:1,BUTTON_2:2,BUTTON_3:3,BUTTON_4:4,BUTTON_5:5,BUTTON_6:6,BUTTON_7:7,BUTTON_8:8,BUTTON_9:9,BUTTON_10:10,BUTTON_11:11,FORWARD:9,LEFT:1,MIDDLE:2,NONE:0,RELEASE:0,RIGHT:3,WHEEL_DOWN:5,WHEEL_LEFT:6,WHEEL_RIGHT:7,WHEEL_UP:4},O=(e,s,T={})=>{let n;if(e===t.RELEASE)n=N;else if(e>=t.LEFT&&e<=t.RIGHT)n=e-t.LEFT;else if(e>=t.WHEEL_UP&&e<=t.WHEEL_RIGHT)n=e-t.WHEEL_UP,n|=_;else if(e>=t.BACKWARD&&e<=t.BUTTON_11)n=e-t.BACKWARD,n|=a;else return 255;return T.shift&&(n|=l),T.alt&&(n|=i),T.ctrl&&(n|=B),s&&(n|=$),n},U=(e,s,T)=>{if(e===255)return"";const n=String.fromCodePoint(e+E),r=String.fromCodePoint(s+1+E),u=String.fromCodePoint(T+1+E);return`${o}[M${n}${r}${u}`},L=(e,s,T,n)=>{if(e===255)return"";const r=n?"m":"M";return`${o}[<${String(e)};${String(s+1)};${String(T+1)}${r}`},S=`${o}[?9h`,c=`${o}[?9l`,b=`${o}[?1000h`,W=`${o}[?1000l`,f=`${o}[?1002h`,g=`${o}[?1002l`,A=`${o}[?1003h`,H=`${o}[?1003l`,R=`${o}[?1006h`,d=`${o}[?1006l`,m=`${o}[?1004h`,h=`${o}[?1004l`;export{t as MouseButton,H as disableAnyEventMouse,g as disableButtonEventMouse,h as disableFocusTracking,W as disableNormalMouse,d as disableSgrMouse,c as disableX10Mouse,A as enableAnyEventMouse,f as enableButtonEventMouse,m as enableFocusTracking,b as enableNormalMouse,R as enableSgrMouse,S as enableX10Mouse,O as encodeMouseButtonByte,L as mouseSgrSequence,U as mouseX10Sequence};
@@ -0,0 +1 @@
1
+ const i="auto",e=t=>t.toString(),n=t=>`${String(t)}px`,r=t=>`${String(t)}%`;export{i as IT2_AUTO,e as it2Cells,r as it2Percent,n as it2Pixels};
@@ -0,0 +1 @@
1
+ import{createRequire as o}from"node:module";const n=o(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=t=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,r]=s.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return s.getBuiltinModule(t)}return n(t)},{Buffer:h}=l("node:buffer"),i=t=>{const e=[];return t.name&&e.push(`name=${t.name}`),t.size!==void 0&&e.push(`size=${String(t.size)}`),t.width!==void 0&&e.push(`width=${t.width.toString()}`),t.height!==void 0&&e.push(`height=${t.height.toString()}`),t.ignoreAspectRatio&&e.push("preserveAspectRatio=0"),t.inline&&e.push("inline=1"),t.doNotMoveCursor&&e.push("doNotMoveCursor=1"),e.join(";")};class u{fileProps;constructor(e,r){if(this.fileProps={...e},r){if(r.byteLength>10*1024*1024)throw new Error("File size exceeds maximum limit of 10MB");if(this.fileProps.content=h.from(r).toString("base64"),this.fileProps.size??=r.byteLength,this.fileProps.size!==r.byteLength)throw new Error("File size property doesn't match actual data length")}}toString(){let e="File=";return e+=i(this.fileProps),this.fileProps.content!==void 0&&(e+=`:${this.fileProps.content}`),e}}class c{toString(){return"FileEnd"}}class a{constructor(e){this.base64Chunk=e}base64Chunk;toString(){return`FilePart=${this.base64Chunk}`}}class f{constructor(e){this.properties=e}properties;toString(){return`MultipartFile=${i(this.properties)}`}}export{u as ITerm2File,c as ITerm2FileEnd,a as ITerm2FilePart,f as ITerm2MultipartFileStart};
@@ -0,0 +1 @@
1
+ import{CSI as s,ESC as o,SEP as t}from"../constants.js";import"./restoreCursor-CyaXIMQf.js";const $=typeof globalThis<"u"&&typeof globalThis.window=="object"&&globalThis.window.document!==void 0,e=/^(?:msys|cygwin)$/,n=!$&&process.env.TERM_PROGRAM==="Apple_Terminal",B=!$&&(process.platform==="win32"||e.test(process.env.OSTYPE)),S=`${o}7`,c=`${o}8`,C=`${s}A`,_=`${s}B`,E=`${s}C`,O=`${s}D`,T=`${s}6n`,U=`${s}?6n`,l=(r=1)=>`${s}${String(r)}D`,p=(r=1)=>`${s}${String(r)}B`,w=(r=1)=>`${s}${String(r)}C`,k=`${s}?25l`,y=`${s}G`,A=(r=1)=>l(r),g=(r=1)=>`${s}${String(r)}G`,D=(r,a)=>{let i="";return r<0?i+=`${s}${String(-r)}D`:r>0&&(i+=`${s}${String(r)}C`),a<0?i+=`${s}${String(-a)}A`:a>0&&(i+=`${s}${String(a)}B`),i},m=(r=1)=>`${s}${String(r)}E`,v=(r=1)=>`${s}${String(r)}F`,b=n?c:`${o}u`,f=n?S:`${o}s`,P=`${s}?25h`,h=(r,a)=>a===void 0?g(r+1):`${s}${String(a+1)}${t}${String(r+1)}H`,H=(r,a)=>a===void 0?`${s}${String(r)}H`:`${s}${String(r)}${t}${String(a)}H`,I=(r=1)=>`${s}${String(r)}I`,N=(r=1)=>`${s}${String(r)}Z`,F=(r=1)=>`${s}${String(r)}X`,W=(r=1)=>`${s}${String(r)}d`,x=(r=1)=>`${s}${String(r)}A`;var u=(r=>(r[r.Default=0]="Default",r[r.BlinkingBlock=1]="BlinkingBlock",r[r.SteadyBlock=2]="SteadyBlock",r[r.BlinkingUnderline=3]="BlinkingUnderline",r[r.SteadyUnderline=4]="SteadyUnderline",r[r.BlinkingBar=5]="BlinkingBar",r[r.SteadyBar=6]="SteadyBar",r))(u||{});const z=r=>`${s}${String(r)} q`;export{B as A,u as B,O as C,T as R,S,_ as a,E as b,C as c,U as d,c as e,l as f,N as g,p as h,w as i,k as j,g as k,I as l,A as m,D as n,m as o,H as p,v as q,b as r,f as s,P as t,h as u,y as v,x as w,W as x,F as y,z};
@@ -0,0 +1,2 @@
1
+ import{createRequire as g}from"node:module";const U=g(import.meta.url),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,a=x,w=(e,t,i,s)=>{if(i==="length"||i==="prototype"||i==="arguments"||i==="caller")return;const r=Object.getOwnPropertyDescriptor(e,i),n=Object.getOwnPropertyDescriptor(t,i);!S(r,n)&&s||Object.defineProperty(e,i,n)},S=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},_=(e,t)=>{const i=Object.getPrototypeOf(t);i!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,i)},I=(e,t)=>`/* Wrapped ${e}*/
2
+ ${t}`,O=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),E=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),T=(e,t,i)=>{const s=i===""?"":`with ${i.trim()}() `,r=I.bind(null,s,t.toString());Object.defineProperty(r,"name",E);const{writable:n,enumerable:l,configurable:f}=O;Object.defineProperty(e,"toString",{value:r,writable:n,enumerable:l,configurable:f})};function G(e,t,{ignoreNonConfigurable:i=!1}={}){const{name:s}=e;for(const r of Reflect.ownKeys(t))w(e,t,r,i);return _(e,t),T(e,t,s),e}const u=new WeakMap,b=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let i,s=0;const r=e.displayName||e.name||"<anonymous>",n=function(...l){if(u.set(n,++s),s===1)i=e.apply(this,l),e=void 0;else if(t.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return i};return G(n,e),u.set(n,s),n};b.callCount=e=>{if(!u.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return u.get(e)};const o=[];o.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&o.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&o.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const c=e=>!!e&&!0&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",h=Symbol.for("signal-exit emitter"),p=globalThis,P=Object.defineProperty.bind(Object);class j{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(p[h])return p[h];P(p,h,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,i){this.listeners[t].push(i)}removeListener(t,i){const s=this.listeners[t],r=s.indexOf(i);r!==-1&&(r===0&&s.length===1?s.length=0:s.splice(r,1))}emit(t,i,s){if(this.emitted[t])return!1;this.emitted[t]=!0;let r=!1;for(const n of this.listeners[t])r=n(i,s)===!0||r;return t==="exit"&&(r=this.emit("afterExit",i,s)||r),r}}class y{}const v=e=>({onExit(t,i){return e.onExit(t,i)},load(){return e.load()},unload(){return e.unload()}});class L extends y{onExit(){return()=>{}}load(){}unload(){}}class $ extends y{#o=d.platform==="win32"?"SIGINT":"SIGHUP";#e=new j;#t;#r;#n;#s={};#i=!1;constructor(t){super(),this.#t=t,this.#s={};for(const i of o)this.#s[i]=()=>{const s=this.#t.listeners(i);let{count:r}=this.#e;const n=t;if(typeof n.__signal_exit_emitter__=="object"&&typeof n.__signal_exit_emitter__.count=="number"&&(r+=n.__signal_exit_emitter__.count),s.length===r){this.unload();const l=this.#e.emit("exit",null,i),f=i==="SIGHUP"?this.#o:i;l||t.kill(t.pid,f)}};this.#n=t.reallyExit,this.#r=t.emit}onExit(t,i){if(!c(this.#t))return()=>{};this.#i===!1&&this.load();const s=i?.alwaysLast?"afterExit":"exit";return this.#e.on(s,t),()=>{this.#e.removeListener(s,t),this.#e.listeners.exit.length===0&&this.#e.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#e.count+=1;for(const t of o)try{const i=this.#s[t];i&&this.#t.on(t,i)}catch{}this.#t.emit=(t,...i)=>this.#a(t,...i),this.#t.reallyExit=t=>this.#l(t)}}unload(){this.#i&&(this.#i=!1,o.forEach(t=>{const i=this.#s[t];if(!i)throw new Error("Listener not defined for signal: "+t);try{this.#t.removeListener(t,i)}catch{}}),this.#t.emit=this.#r,this.#t.reallyExit=this.#n,this.#e.count-=1)}#l(t){return c(this.#t)?(this.#t.exitCode=t||0,this.#e.emit("exit",this.#t.exitCode,null),this.#n.call(this.#t,this.#t.exitCode)):0}#a(t,...i){const s=this.#r;if(t==="exit"&&c(this.#t)){typeof i[0]=="number"&&(this.#t.exitCode=i[0]);const r=s.call(this.#t,t,...i);return this.#e.emit("exit",this.#t.exitCode,null),r}else return s.call(this.#t,t,...i)}}const d=globalThis.process,{onExit:R}=v(c(d)?new $(d):new L),m=a.stderr.isTTY?a.stderr:a.stdout.isTTY?a.stdout:void 0,F=m?b(()=>{R(()=>{m.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{};export{F as default};
@@ -1 +1 @@
1
- var g=Object.defineProperty;var l=(e,t)=>g(e,"name",{value:t,configurable:!0});import{a as o,D as a,E as n}from"./packem_shared/constants-D12jy2Zh.js";var c=Object.defineProperty,u=l((e,t)=>c(e,"name",{value:t,configurable:!0}),"o");const E=0,i=768,P=u((e,t=E)=>{let r=a;if(t>0&&e.length>t)for(let s=0;s<e.length;s+=t){const h=Math.min(s+t,e.length);r+=e.slice(s,h),h<e.length&&(r+=o+a)}else r+=e;return r+=o,r},"screenPassthrough"),x=u(e=>{let t="";for(const r of e)t+=r===n?n+n:r;return`${a}tmux;${t}${o}`},"tmuxPassthrough");export{E as SCREEN_MAX_LEN_DEFAULT,i as SCREEN_TYPICAL_LIMIT,P as screenPassthrough,x as 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,42 @@
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
+ declare const resetProgressBar: string;
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
+ declare const setProgressBar: (percentage: number) => string;
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
+ declare const setErrorProgressBar: (percentage: number) => string;
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
+ declare const setIndeterminateProgressBar: string;
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
+ 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/screen.js CHANGED
@@ -1 +1 @@
1
- var $=Object.defineProperty;var s=(e,r)=>$(e,"name",{value:r,configurable:!0});import{C as t,S as o}from"./packem_shared/constants-D12jy2Zh.js";var g=Object.defineProperty,n=s((e,r)=>g(e,"name",{value:r,configurable:!0}),"n");const p=n((e=1)=>`${t}${e<=1?"":String(e)}L`,"insertLine"),u=n((e=1)=>`${t}${e<=1?"":String(e)}M`,"deleteLine"),h=n((e,r)=>{const i=e&&e>0?e.toString():"",a=r&&r>0?r.toString():"";return i===""&&a===""?`${t}${o}r`:`${t}${i}${o}${a}r`},"setTopBottomMargins"),l=n((e,r)=>{const i=e&&e>0?e.toString():"",a=r&&r>0?r.toString():"";return i===""&&a===""?`${t}${o}s`:`${t}${i}${o}${a}s`},"setLeftRightMargins"),C=n((e=1)=>`${t}${e<=1?"":String(e)}@`,"insertCharacter"),L=n((e=1)=>`${t}${e<=1?"":String(e)}P`,"deleteCharacter"),P=n((e=0)=>`${t}${String(e)}g`,"clearTabStop"),b=n(e=>`${t}${String(e)}$u`,"requestPresentationStateReport"),d=n((e=1)=>`${t}${e<=1?"":String(e)}b`,"repeatPreviousCharacter");export{P as clearTabStop,L as deleteCharacter,u as deleteLine,C as insertCharacter,p as insertLine,d as repeatPreviousCharacter,b as requestPresentationStateReport,l as setLeftRightMargins,h as setTopBottomMargins};
1
+ import{CSI as t,SEP as n}from"./constants.js";const g=(r=1)=>`${t}${r<=1?"":String(r)}L`,S=(r=1)=>`${t}${r<=1?"":String(r)}M`,s=(r,e)=>{const $=r&&r>0?r.toString():"",i=e&&e>0?e.toString():"";return $===""&&i===""?`${t}${n}r`:`${t}${$}${n}${i}r`},a=(r,e)=>{const $=r&&r>0?r.toString():"",i=e&&e>0?e.toString():"";return $===""&&i===""?`${t}${n}s`:`${t}${$}${n}${i}s`},c=(r=1)=>`${t}${r<=1?"":String(r)}@`,p=(r=1)=>`${t}${r<=1?"":String(r)}P`,u=(r=0)=>`${t}${String(r)}g`,h=r=>`${t}${String(r)}$u`,C=(r=1)=>`${t}${r<=1?"":String(r)}b`;export{u as clearTabStop,p as deleteCharacter,S as deleteLine,c as insertCharacter,g as insertLine,C as repeatPreviousCharacter,h as requestPresentationStateReport,a as setLeftRightMargins,s as setTopBottomMargins};
package/dist/scroll.js CHANGED
@@ -1 +1 @@
1
- var t=Object.defineProperty;var e=(o,l)=>t(o,"name",{value:l,configurable:!0});import{C as r}from"./packem_shared/constants-D12jy2Zh.js";var c=Object.defineProperty,n=e((o,l)=>c(o,"name",{value:l,configurable:!0}),"n");const i=n((o=1)=>o===0?"":`${r}${o<=1?"":String(o)}S`,"scrollUp"),s=n((o=1)=>o===0?"":`${r}${o<=1?"":String(o)}T`,"scrollDown"),$=`${r}S`,p=`${r}T`;export{p as SCROLL_DOWN_1,$ as SCROLL_UP_1,s as scrollDown,i as scrollUp};
1
+ import{CSI as S}from"./constants.js";const t=(o=1)=>o===0?"":`${S}${o<=1?"":String(o)}S`,l=(o=1)=>o===0?"":`${S}${o<=1?"":String(o)}T`,n=`${S}S`,L=`${S}T`;export{L as SCROLL_DOWN_1,n as SCROLL_UP_1,l as scrollDown,t as scrollUp};
package/dist/status.js CHANGED
@@ -1 +1 @@
1
- var $=Object.defineProperty;var D=(t,r)=>$(t,"name",{value:r,configurable:!0});import{C as e,S as i,D as S,a as R}from"./packem_shared/constants-D12jy2Zh.js";var C=Object.defineProperty,o=D((t,r)=>C(t,"name",{value:r,configurable:!0}),"e");class m{static{D(this,"x")}constructor(r){this.reportCode=r}reportCode;static{o(this,"AnsiStatusReportImpl")}isDecReport=!1}class d{static{D(this,"m")}constructor(r){this.reportCode=r}reportCode;static{o(this,"DecStatusReportImpl")}isDecReport=!0}const g=o(t=>new m(t),"createAnsiStatusReport"),p=o(t=>new d(t),"createDecStatusReport"),c=o((...t)=>{if(t.length===0)return"";const r=t.some(n=>n.isDecReport),a=t.map(n=>n.reportCode.toString());let s=e;return r&&(s+="?"),`${s}${a.join(i)}n`},"deviceStatusReport"),L=o(t=>c(t),"DSR"),M=`${e}6n`,f=`${e}?6n`,P=o((t,r)=>{const a=Math.max(1,t),s=Math.max(1,r);return`${e}${a.toString()}${i}${s.toString()}R`},"cursorPositionReport"),k=P,y=o((t,r,a)=>{const s=Math.max(1,t),n=Math.max(1,r);let u=`${e}?`;return u+=s.toString()+i+n.toString(),a>0&&(u+=i+a.toString()),u+="R",u},"extendedCursorPositionReport"),N=y,b=`${e}>0q`,U=b,A=`${e}c`,I=A,O=o((...t)=>t.length===0?"":`${e}?${t.join(i)}c`,"reportPrimaryDeviceAttributes"),v=`${e}>c`,_=v,j=o((t,r,a=0)=>{const s=Math.max(0,t),n=Math.max(0,r),u=Math.max(0,a);return`${e}>${String(s)}${i}${String(n)}${i}${String(u)}c`},"reportSecondaryDeviceAttributes"),E=`${e}=c`,w=E,V=o(t=>`${S}!|${t}${R}`,"reportTertiaryDeviceAttributes"),X=`${e}0c`,z=`${e}>0c`,B=`${e}=0c`,h=g(5),F=c(h),G=`${e}0n`,H=`${e}3n`,l=p(15),J=c(l),Q=`${e}?10n`,W=`${e}?11n`,Y=`${e}?13n`,q=p(25),Z=c(q),tt=`${e}?20n`,et=`${e}?21n`,x=p(26),rt=c(x),ot=o(t=>`${e}?27${i}${t.toString()}n`,"reportKeyboardLanguageDEC"),it=`${e}?996n`,at=o(t=>`${e}?997${i}${t?"1":"2"}n`,"LightDarkReport");export{k as CPR,I as DA1,_ as DA2,w as DA3,N as DECXCPR,L as DSR,rt as DSR_KeyboardLanguageDEC,J as DSR_PrinterStatusDEC,F as DSR_TerminalStatus,Z as DSR_UDKStatusDEC,at as LightDarkReport,it as RequestLightDarkReport,b as RequestNameVersion,U as XTVERSION,g as createAnsiStatusReport,p as createDecStatusReport,P as cursorPositionReport,c as deviceStatusReport,y as extendedCursorPositionReport,ot as reportKeyboardLanguageDEC,O as reportPrimaryDeviceAttributes,Y as reportPrinterNoPaperDEC,W as reportPrinterNotReadyDEC,Q as reportPrinterReadyDEC,j as reportSecondaryDeviceAttributes,H as reportTerminalNotOK,G as reportTerminalOK,V as reportTertiaryDeviceAttributes,tt as reportUDKLockedDEC,et as reportUDKUnlockedDEC,M as requestCursorPositionReport,f as requestExtendedCursorPositionReport,x as requestKeyboardLanguageDEC,A as requestPrimaryDeviceAttributes,X as requestPrimaryDeviceAttributesParam0,l as requestPrinterStatusDEC,v as requestSecondaryDeviceAttributes,z as requestSecondaryDeviceAttributesParam0,h as requestTerminalStatus,E as requestTertiaryDeviceAttributes,B as requestTertiaryDeviceAttributesParam0,q as requestUDKStatusDEC};
1
+ import{CSI as e,SEP as o,DCS as D,ST as $}from"./constants.js";class p{constructor(r){this.reportCode=r}reportCode;isDecReport=!1}class S{constructor(r){this.reportCode=r}reportCode;isDecReport=!0}const R=t=>new p(t),c=t=>new S(t),u=(...t)=>{if(t.length===0)return"";const r=t.some(a=>a.isDecReport),i=t.map(a=>a.reportCode.toString());let n=e;return r&&(n+="?"),`${n}${i.join(o)}n`},l=t=>u(t),v=`${e}6n`,x=`${e}?6n`,C=(t,r)=>{const i=Math.max(1,t),n=Math.max(1,r);return`${e}${i.toString()}${o}${n.toString()}R`},K=C,m=(t,r,i)=>{const n=Math.max(1,t),a=Math.max(1,r);let s=`${e}?`;return s+=n.toString()+o+a.toString(),i>0&&(s+=o+i.toString()),s+="R",s},T=m,g=`${e}>0q`,M=g,d=`${e}c`,L=d,N=(...t)=>t.length===0?"":`${e}?${t.join(o)}c`,P=`${e}>c`,U=P,k=(t,r,i=0)=>{const n=Math.max(0,t),a=Math.max(0,r),s=Math.max(0,i);return`${e}>${String(n)}${o}${String(a)}${o}${String(s)}c`},E=`${e}=c`,_=E,f=t=>`${D}!|${t}${$}`,O=`${e}0c`,j=`${e}>0c`,w=`${e}=0c`,q=R(5),I=u(q),V=`${e}0n`,X=`${e}3n`,y=c(15),z=u(y),B=`${e}?10n`,F=`${e}?11n`,G=`${e}?13n`,h=c(25),H=u(h),J=`${e}?20n`,Q=`${e}?21n`,A=c(26),W=u(A),Y=t=>`${e}?27${o}${t.toString()}n`,Z=`${e}?996n`,tt=t=>`${e}?997${o}${t?"1":"2"}n`;export{K as CPR,L as DA1,U as DA2,_ as DA3,T as DECXCPR,l as DSR,W as DSR_KeyboardLanguageDEC,z as DSR_PrinterStatusDEC,I as DSR_TerminalStatus,H as DSR_UDKStatusDEC,tt as LightDarkReport,Z as RequestLightDarkReport,g as RequestNameVersion,M as XTVERSION,R as createAnsiStatusReport,c as createDecStatusReport,C as cursorPositionReport,u as deviceStatusReport,m as extendedCursorPositionReport,Y as reportKeyboardLanguageDEC,N as reportPrimaryDeviceAttributes,G as reportPrinterNoPaperDEC,F as reportPrinterNotReadyDEC,B as reportPrinterReadyDEC,k as reportSecondaryDeviceAttributes,X as reportTerminalNotOK,V as reportTerminalOK,f as reportTertiaryDeviceAttributes,J as reportUDKLockedDEC,Q as reportUDKUnlockedDEC,v as requestCursorPositionReport,x as requestExtendedCursorPositionReport,A as requestKeyboardLanguageDEC,d as requestPrimaryDeviceAttributes,O as requestPrimaryDeviceAttributesParam0,y as requestPrinterStatusDEC,P as requestSecondaryDeviceAttributes,j as requestSecondaryDeviceAttributesParam0,q as requestTerminalStatus,E as requestTertiaryDeviceAttributes,w as requestTertiaryDeviceAttributesParam0,h as requestUDKStatusDEC};
package/dist/strip.d.ts CHANGED
@@ -1,2 +1,27 @@
1
+ /**
2
+ * Removes ANSI escape codes from a string.
3
+ *
4
+ * The implementation is a single linear pass over the input (O(n)) — it never
5
+ * relies on a backtracking regular expression, so it is safe to run on
6
+ * untrusted subprocess/log output without risking polynomial ReDoS on
7
+ * adversarial input (e.g. many unterminated `ESC ]` prefixes).
8
+ *
9
+ * Recognised sequences: CSI (`ESC [ ... final`, final byte `0x40`-`0x7e`),
10
+ * OSC (`ESC ] ... BEL` or terminated by ST, covering window titles and
11
+ * hyperlinks), string sequences DCS/SOS/PM/APC (`ESC P|X|^|_ ... ST`), and
12
+ * two-character escapes (`ESC` plus a single byte, e.g. `ESC 7`, `ESC c`).
13
+ * The 8-bit C1 single-byte introducers (`0x9b` CSI, `0x9d` OSC, `0x90` DCS,
14
+ * `0x98` SOS, `0x9e` PM, `0x9f` APC) are recognised as equivalents of their
15
+ * `ESC`-prefixed forms.
16
+ * @param input The string from which to remove ANSI escape codes.
17
+ * @returns The input string with all ANSI escape codes stripped.
18
+ * @example
19
+ * ```typescript
20
+ * import { strip } from "@visulima/ansi";
21
+ *
22
+ * const textWithAnsi = "\x1b[32mHello\x1b[0m";
23
+ * console.log(strip(textWithAnsi)); // "Hello"
24
+ * ```
25
+ */
1
26
  declare const strip: (input: string) => string;
2
27
  export { strip as default };
package/dist/strip.js CHANGED
@@ -1 +1 @@
1
- var n=Object.defineProperty;var u=(e,r)=>n(e,"name",{value:r,configurable:!0});var t=Object.defineProperty,c=u((e,r)=>t(e,"name",{value:r,configurable:!0}),"e");function a({onlyFirst:e=!1}={}){const r="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(r,e?void 0:"g")}u(a,"t");c(a,"ansiRegex");var o=Object.defineProperty,i=u((e,r)=>o(e,"name",{value:r,configurable:!0}),"r");const s=a(),l=/\u001B\]0;.*\u0007/,d=i(e=>e.replace(l,"").replace(s,""),"strip");export{d as default};
1
+ const f=t=>t===155||t===157||t===144||t===152||t===158||t===159,s=(t,o)=>{for(let e=o;e<t.length;e+=1){const r=t.codePointAt(e);if(r>=64&&r<=126)return e}return-1},c=(t,o,e)=>{for(let r=o;r<t.length;r+=1){const i=t.codePointAt(r);if(i===156||e&&i===7)return r;if(i===27&&t.codePointAt(r+1)===92)return r+1}return-1},n=(t,o)=>{const e=t.codePointAt(o+1);return e===91?s(t,o+2):e===93?c(t,o+2,!0):e===80||e===88||e===94||e===95?c(t,o+2,!1):e!==void 0?o+1:-1},d=(t,o)=>{const e=t.codePointAt(o);return e===155?s(t,o+1):e===157?c(t,o+1,!0):e===144||e===152||e===158||e===159?c(t,o+1,!1):-1},A=t=>{if(t.includes(String.fromCodePoint(27)))return!0;for(let o=0;o<t.length;o+=1)if(f(t.codePointAt(o)))return!0;return!1},P=t=>{if(!A(t))return t;let o="",e=0,r=0;const{length:i}=t;for(;r<i;){const l=t.codePointAt(r);let u;if(l===27)u=n(t,r);else if(f(l))u=d(t,r);else{r+=1;continue}u===-1&&(u=i-1),o+=t.slice(e,r),e=u+1,r=u+1}return o+=t.slice(e),o};export{P as default};
package/dist/termcap.js CHANGED
@@ -1 +1 @@
1
- var c=Object.defineProperty;var i=(e,t)=>c(e,"name",{value:t,configurable:!0});import{D as T,a as u,S as f}from"./packem_shared/constants-D12jy2Zh.js";var l=Object.defineProperty,s=i((e,t)=>l(e,"name",{value:t,configurable:!0}),"o");const p=s(e=>{let t="";for(let r=0;r<e.length;r+=1){const o=e.codePointAt(r);if(o===void 0)continue;const n=o.toString(16).toUpperCase();t+=n.length===1?`0${n}`:n}return t},"stringToHex"),a=s((...e)=>{if(e.length===0)return"";const t=e.map(r=>p(r));return`${T}+q${t.join(f)}${u}`},"XTGETTCAP"),P=a,S=a;export{a as XTGETTCAP,P as requestTermcap,S as requestTerminfo};
1
+ import{DCS as n,ST as c,SEP as p}from"./constants.js";const s=e=>{let r="";for(const t of new TextEncoder().encode(e))r+=t.toString(16).toUpperCase().padStart(2,"0");return r},o=(...e)=>{if(e.length===0)return"";const r=e.map(t=>s(t));return`${n}+q${r.join(p)}${c}`},i=o,a=o;export{o as XTGETTCAP,i as requestTermcap,a as requestTerminfo};
package/dist/title.js CHANGED
@@ -1 +1 @@
1
- var r=Object.defineProperty;var a=(e,$)=>r(e,"name",{value:$,configurable:!0});import{O as i,a as o,B as s}from"./packem_shared/constants-D12jy2Zh.js";var d=Object.defineProperty,t=a((e,$)=>d(e,"name",{value:$,configurable:!0}),"n");const T=/[\u0007\u001B]/g,n=t(e=>{if(typeof e!="string")throw new TypeError("Title must be a string");return e.replaceAll(T,"")},"validateTitle"),W=t(e=>`${i}0;${n(e)}${s}`,"setIconNameAndWindowTitle"),m=t(e=>`${i}1;${n(e)}${s}`,"setIconName"),w=t(e=>`${i}2;${n(e)}${s}`,"setWindowTitle"),I=t(e=>`${i}21;${n(e)}${o}`,"decswt"),N=t(e=>`${i}2L;${n(e)}${o}`,"decsin"),S=t(e=>`${i}0;${n(e)}${o}`,"setIconNameAndWindowTitleWithST"),h=t(e=>`${i}1;${n(e)}${o}`,"setIconNameWithST"),u=t(e=>`${i}2;${n(e)}${o}`,"setWindowTitleWithST");export{N as decsin,I as decswt,m as setIconName,W as setIconNameAndWindowTitle,S as setIconNameAndWindowTitleWithST,h as setIconNameWithST,w as setWindowTitle,u as setWindowTitleWithST};
1
+ import{OSC as t,ST as i,BEL as n}from"./constants.js";const o=/[\u0007\u001B]/g,$=e=>{if(typeof e!="string")throw new TypeError("Title must be a string");return e.replaceAll(o,"")},r=e=>`${t}0;${$(e)}${n}`,T=e=>`${t}1;${$(e)}${n}`,c=e=>`${t}2;${$(e)}${n}`,d=e=>`${t}21;${$(e)}${i}`,l=e=>`${t}2L;${$(e)}${i}`,m=e=>`${t}0;${$(e)}${i}`,w=e=>`${t}1;${$(e)}${i}`,W=e=>`${t}2;${$(e)}${i}`;export{l as decsin,d as decswt,T as setIconName,r as setIconNameAndWindowTitle,m as setIconNameAndWindowTitleWithST,w as setIconNameWithST,c as setWindowTitle,W as setWindowTitleWithST};
@@ -1 +1 @@
1
- var R=Object.defineProperty;var T=(_,W)=>R(_,"name",{value:W,configurable:!0});import{C as E}from"./packem_shared/constants-D12jy2Zh.js";var r=Object.defineProperty,e=T((_,W)=>r(_,"name",{value:W,configurable:!0}),"_"),A=(_=>(_[_.DEICONIFY_WINDOW=1]="DEICONIFY_WINDOW",_[_.ICONIFY_WINDOW=2]="ICONIFY_WINDOW",_[_.MOVE_WINDOW=3]="MOVE_WINDOW",_[_.RESIZE_TEXT_AREA_CHARS=4]="RESIZE_TEXT_AREA_CHARS",_[_.RAISE_WINDOW=5]="RAISE_WINDOW",_[_.LOWER_WINDOW=6]="LOWER_WINDOW",_[_.REFRESH_WINDOW=7]="REFRESH_WINDOW",_[_.RESIZE_TEXT_AREA_PIXELS=8]="RESIZE_TEXT_AREA_PIXELS",_[_.RESTORE_MAXIMIZED_WINDOW=9]="RESTORE_MAXIMIZED_WINDOW",_[_.MAXIMIZE_WINDOW=10]="MAXIMIZE_WINDOW",_[_.MAXIMIZE_WINDOW_VERTICALLY=10.1]="MAXIMIZE_WINDOW_VERTICALLY",_[_.MAXIMIZE_WINDOW_HORIZONTALLY=10.2]="MAXIMIZE_WINDOW_HORIZONTALLY",_[_.UNDO_FULL_SCREEN_MODE=10.3]="UNDO_FULL_SCREEN_MODE",_[_.REPORT_WINDOW_STATE=11]="REPORT_WINDOW_STATE",_[_.REPORT_WINDOW_POSITION=13]="REPORT_WINDOW_POSITION",_[_.REPORT_TEXT_AREA_SIZE_CHARS=14]="REPORT_TEXT_AREA_SIZE_CHARS",_[_.REQUEST_WINDOW_SIZE_WIN_OP_COMPAT=14]="REQUEST_WINDOW_SIZE_WIN_OP_COMPAT",_[_.REPORT_CELL_SIZE_PIXELS=16]="REPORT_CELL_SIZE_PIXELS",_[_.REPORT_TEXT_AREA_SIZE_PIXELS=18]="REPORT_TEXT_AREA_SIZE_PIXELS",_[_.REPORT_ICON_LABEL=19]="REPORT_ICON_LABEL",_[_.REPORT_WINDOW_TITLE=21]="REPORT_WINDOW_TITLE",_[_.PUSH_WINDOW_TITLE=22]="PUSH_WINDOW_TITLE",_[_.POP_WINDOW_TITLE=23]="POP_WINDOW_TITLE",_[_.RESIZE_SCREEN_AND_TEXT_AREA=24]="RESIZE_SCREEN_AND_TEXT_AREA",_))(A||{});const I=e((_,...W)=>{if(![10.1,10.2,10.3].includes(_)&&_<=0)return"";const O=[_];return W.forEach(i=>{i>=0&&O.push(i)}),`${E}${O.join(";")}t`},"xtermWindowOp"),o=I,P=e((_,W)=>I(4,_,W),"resizeTextAreaChars"),D=e(()=>I(14),"requestTextAreaSizeChars"),n=e(()=>I(16),"requestCellSizePixels"),t=e(()=>I(18),"requestTextAreaSizePixels"),s=e(()=>I(1),"deiconifyWindow"),L=e(()=>I(2),"iconifyWindow"),a=e((_,W)=>I(3,_,W),"moveWindow"),d=e(()=>I(5),"raiseWindow"),C=e(()=>I(6),"lowerWindow"),X=e(()=>I(7),"refreshWindow"),w=e((_,W)=>I(8,_,W),"resizeTextAreaPixels"),M=e(()=>I(9),"restoreMaximizedWindow"),Z=e(()=>I(10),"maximizeWindow"),x=e(()=>I(13),"reportWindowPosition"),z=e(()=>I(11),"reportWindowState"),l=e(_=>I(24,_),"setPageSizeLines");export{o as XTWINOPS,A as XTermWindowOp,s as deiconifyWindow,L as iconifyWindow,C as lowerWindow,Z as maximizeWindow,a as moveWindow,d as raiseWindow,X as refreshWindow,x as reportWindowPosition,z as reportWindowState,n as requestCellSizePixels,D as requestTextAreaSizeChars,t as requestTextAreaSizePixels,P as resizeTextAreaChars,w as resizeTextAreaPixels,M as restoreMaximizedWindow,l as setPageSizeLines,I as xtermWindowOp};
1
+ import{CSI as T}from"./constants.js";var E=(_=>(_[_.DEICONIFY_WINDOW=1]="DEICONIFY_WINDOW",_[_.ICONIFY_WINDOW=2]="ICONIFY_WINDOW",_[_.MOVE_WINDOW=3]="MOVE_WINDOW",_[_.RESIZE_TEXT_AREA_CHARS=4]="RESIZE_TEXT_AREA_CHARS",_[_.RAISE_WINDOW=5]="RAISE_WINDOW",_[_.LOWER_WINDOW=6]="LOWER_WINDOW",_[_.REFRESH_WINDOW=7]="REFRESH_WINDOW",_[_.RESIZE_TEXT_AREA_PIXELS=8]="RESIZE_TEXT_AREA_PIXELS",_[_.RESTORE_MAXIMIZED_WINDOW=9]="RESTORE_MAXIMIZED_WINDOW",_[_.MAXIMIZE_WINDOW=10]="MAXIMIZE_WINDOW",_[_.MAXIMIZE_WINDOW_VERTICALLY=10.1]="MAXIMIZE_WINDOW_VERTICALLY",_[_.MAXIMIZE_WINDOW_HORIZONTALLY=10.2]="MAXIMIZE_WINDOW_HORIZONTALLY",_[_.UNDO_FULL_SCREEN_MODE=10.3]="UNDO_FULL_SCREEN_MODE",_[_.REPORT_WINDOW_STATE=11]="REPORT_WINDOW_STATE",_[_.REPORT_WINDOW_POSITION=13]="REPORT_WINDOW_POSITION",_[_.REPORT_TEXT_AREA_SIZE_CHARS=14]="REPORT_TEXT_AREA_SIZE_CHARS",_[_.REQUEST_WINDOW_SIZE_WIN_OP_COMPAT=14]="REQUEST_WINDOW_SIZE_WIN_OP_COMPAT",_[_.REPORT_CELL_SIZE_PIXELS=16]="REPORT_CELL_SIZE_PIXELS",_[_.REPORT_TEXT_AREA_SIZE_PIXELS=18]="REPORT_TEXT_AREA_SIZE_PIXELS",_[_.REPORT_ICON_LABEL=19]="REPORT_ICON_LABEL",_[_.REPORT_WINDOW_TITLE=21]="REPORT_WINDOW_TITLE",_[_.PUSH_WINDOW_TITLE=22]="PUSH_WINDOW_TITLE",_[_.POP_WINDOW_TITLE=23]="POP_WINDOW_TITLE",_[_.RESIZE_SCREEN_AND_TEXT_AREA=24]="RESIZE_SCREEN_AND_TEXT_AREA",_))(E||{});const I=(_,...W)=>{if(![10.1,10.2,10.3].includes(_)&&_<=0)return"";const O=[_];return W.forEach(R=>{R>=0&&O.push(R)}),`${T}${O.join(";")}t`},A=I,S=(_,W)=>I(4,_,W),e=()=>I(14),D=()=>I(16),i=()=>I(18),P=()=>I(1),L=()=>I(2),r=(_,W)=>I(3,_,W),o=()=>I(5),X=()=>I(6),C=()=>I(7),Z=(_,W)=>I(8,_,W),t=()=>I(9),M=()=>I(10),n=()=>I(13),s=()=>I(11),d=_=>I(24,_);export{A as XTWINOPS,E as XTermWindowOp,P as deiconifyWindow,L as iconifyWindow,X as lowerWindow,M as maximizeWindow,r as moveWindow,o as raiseWindow,C as refreshWindow,n as reportWindowPosition,s as reportWindowState,D as requestCellSizePixels,e as requestTextAreaSizeChars,i as requestTextAreaSizePixels,S as resizeTextAreaChars,Z as resizeTextAreaPixels,t as restoreMaximizedWindow,d as setPageSizeLines,I as xtermWindowOp};
package/dist/xterm.d.ts CHANGED
@@ -92,4 +92,86 @@ declare const resetModifyOtherKeys: string;
92
92
  * ```
93
93
  */
94
94
  declare const queryModifyOtherKeys: string;
95
- export { XTMODKEYS, XTQMODKEYS, keyModifierOptions, queryKeyModifierOptions, queryModifyOtherKeys, resetKeyModifierOptions, resetModifyOtherKeys, setKeyModifierOptions, setModifyOtherKeys1, setModifyOtherKeys2 };
95
+ /**
96
+ * Bit flags for the Kitty keyboard protocol progressive-enhancement level.
97
+ *
98
+ * Combine members with bitwise OR to request multiple enhancements at once.
99
+ * @see {@link https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement}
100
+ */
101
+ declare const KittyKeyboardFlag: {
102
+ /** Disambiguate escape codes so modifier+key combos are unambiguous. */
103
+ readonly DisambiguateEscapeCodes: 1;
104
+ /** Report all keys as escape codes (so e.g. Enter/Tab/Backspace are reported uniformly). */
105
+ readonly ReportAllKeysAsEscapeCodes: 16;
106
+ /** Report alternate keys (e.g. shifted layout keys and the base layout key). */
107
+ readonly ReportAlternateKeys: 8;
108
+ /** Embed the text the key would produce in the escape code. */
109
+ readonly ReportAssociatedText: 4;
110
+ /** Add event-type data, enabling key-release (and repeat) reporting. */
111
+ readonly ReportEventTypes: 2;
112
+ };
113
+ /**
114
+ * A Kitty keyboard protocol flag value: a bitwise OR of {@link KittyKeyboardFlag}
115
+ * members (range `0`-`31`).
116
+ */
117
+ type KittyKeyboardFlags = number;
118
+ /**
119
+ * Pushes a new set of Kitty keyboard protocol flags onto the terminal's stack.
120
+ *
121
+ * Sequence: `CSI > flags u`
122
+ * @param flags Bitwise OR of {@link KittyKeyboardFlag} values. Defaults to {@link KittyKeyboardFlag.DisambiguateEscapeCodes}.
123
+ * @returns The escape sequence enabling the requested enhancement level.
124
+ * @example
125
+ * ```typescript
126
+ * import { pushKittyKeyboard, KittyKeyboardFlag as Flag } from "@visulima/ansi/xterm";
127
+ *
128
+ * const flags = Flag.DisambiguateEscapeCodes | Flag.ReportEventTypes;
129
+ *
130
+ * process.stdout.write(pushKittyKeyboard(flags));
131
+ * ```
132
+ * @see {@link https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement}
133
+ */
134
+ declare const pushKittyKeyboard: (flags?: KittyKeyboardFlags) => string;
135
+ /**
136
+ * Pops one or more entries from the terminal's Kitty keyboard protocol flag stack,
137
+ * restoring the previous enhancement level. Call this on exit to undo {@link pushKittyKeyboard}.
138
+ *
139
+ * Sequence: `CSI < number u`
140
+ * @param count How many stack entries to pop. Defaults to `1`.
141
+ * @returns The escape sequence popping the stack.
142
+ * @example
143
+ * ```typescript
144
+ * import { popKittyKeyboard } from "@visulima/ansi/xterm";
145
+ *
146
+ * process.stdout.write(popKittyKeyboard());
147
+ * ```
148
+ * @see {@link https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement}
149
+ */
150
+ declare const popKittyKeyboard: (count?: number) => string;
151
+ /**
152
+ * Sets the Kitty keyboard protocol flags, replacing the current top-of-stack
153
+ * entry (mode `1`) rather than pushing a new one.
154
+ *
155
+ * Sequence: `CSI = flags ; 1 u`
156
+ * @param flags Bitwise OR of {@link KittyKeyboardFlag} values.
157
+ * @returns The escape sequence setting the flags.
158
+ * @see {@link https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement}
159
+ */
160
+ declare const setKittyKeyboard: (flags?: KittyKeyboardFlags) => string;
161
+ /**
162
+ * Queries the terminal's current Kitty keyboard protocol flags.
163
+ *
164
+ * Sequence: `CSI ? u`
165
+ * Response: `CSI ? flags u`.
166
+ * @returns The query escape sequence.
167
+ * @example
168
+ * ```typescript
169
+ * import { queryKittyKeyboard } from "@visulima/ansi/xterm";
170
+ *
171
+ * process.stdout.write(queryKittyKeyboard);
172
+ * // Expect a response like: "\x1b[?1u"
173
+ * ```
174
+ * @see {@link https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement}
175
+ */
176
+ declare const queryKittyKeyboard: string;
177
+ export { KittyKeyboardFlag, KittyKeyboardFlags, XTMODKEYS, XTQMODKEYS, keyModifierOptions, popKittyKeyboard, pushKittyKeyboard, queryKeyModifierOptions, queryKittyKeyboard, queryModifyOtherKeys, resetKeyModifierOptions, resetModifyOtherKeys, setKeyModifierOptions, setKittyKeyboard, setModifyOtherKeys1, setModifyOtherKeys2 };
package/dist/xterm.js CHANGED
@@ -1 +1 @@
1
- var f=Object.defineProperty;var s=(e,r)=>f(e,"name",{value:r,configurable:!0});import{C as i}from"./packem_shared/constants-D12jy2Zh.js";var u=Object.defineProperty,t=s((e,r)=>u(e,"name",{value:r,configurable:!0}),"n");const o=t((e,r)=>{if(e<0||!Number.isInteger(e))return"";const n=e.toString();if(r!==void 0){if(!Number.isInteger(r))return"";const y=r.toString();return`${i}>${n};${y}m`}return`${i}>${n}m`},"keyModifierOptions"),m=o,O=t(e=>{if(e<0||!Number.isInteger(e))return"";const r=e.toString();return`${i}?${r}m`},"queryKeyModifierOptions"),K=t(e=>o(e),"resetKeyModifierOptions"),p=t((e,r)=>o(e,r),"setKeyModifierOptions"),$=O,g=`${i}>4;1m`,a=`${i}>4;2m`,c=`${i}>4m`,S=`${i}?4m`;export{m as XTMODKEYS,$ as XTQMODKEYS,o as keyModifierOptions,O as queryKeyModifierOptions,S as queryModifyOtherKeys,K as resetKeyModifierOptions,c as resetModifyOtherKeys,p as setKeyModifierOptions,g as setModifyOtherKeys1,a as setModifyOtherKeys2};
1
+ import{CSI as t}from"./constants.js";const i=(e,r)=>{if(e<0||!Number.isInteger(e))return"";const s=e.toString();if(r!==void 0){if(!Number.isInteger(r))return"";const n=r.toString();return`${t}>${s};${n}m`}return`${t}>${s}m`},K=i,y=e=>{if(e<0||!Number.isInteger(e))return"";const r=e.toString();return`${t}?${r}m`},d=e=>i(e),a=(e,r)=>i(e,r),m=y,p=`${t}>4;1m`,$=`${t}>4;2m`,g=`${t}>4m`,b=`${t}?4m`,o={DisambiguateEscapeCodes:1,ReportAllKeysAsEscapeCodes:16,ReportAlternateKeys:8,ReportAssociatedText:4,ReportEventTypes:2},f=(e=o.DisambiguateEscapeCodes)=>`${t}>${(Number.isInteger(e)&&e>=0?e:0).toString()}u`,M=(e=1)=>`${t}<${(Number.isInteger(e)&&e>0?e:1).toString()}u`,O=(e=o.DisambiguateEscapeCodes)=>`${t}=${(Number.isInteger(e)&&e>=0?e:0).toString()};1u`,c=`${t}?u`;export{o as KittyKeyboardFlag,K as XTMODKEYS,m as XTQMODKEYS,i as keyModifierOptions,M as popKittyKeyboard,f as pushKittyKeyboard,y as queryKeyModifierOptions,c as queryKittyKeyboard,b as queryModifyOtherKeys,d as resetKeyModifierOptions,g as resetModifyOtherKeys,a as setKeyModifierOptions,O as setKittyKeyboard,p as setModifyOtherKeys1,$ as setModifyOtherKeys2};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/ansi",
3
- "version": "4.0.0-alpha.15",
3
+ "version": "4.0.0-alpha.17",
4
4
  "description": "ANSI escape codes for some terminal swag.",
5
5
  "keywords": [
6
6
  "alternative-screen",
@@ -76,6 +76,14 @@
76
76
  "types": "./dist/clear.d.ts",
77
77
  "default": "./dist/clear.js"
78
78
  },
79
+ "./clipboard": {
80
+ "types": "./dist/clipboard.d.ts",
81
+ "default": "./dist/clipboard.js"
82
+ },
83
+ "./constants": {
84
+ "types": "./dist/constants.d.ts",
85
+ "default": "./dist/constants.js"
86
+ },
79
87
  "./cursor": {
80
88
  "types": "./dist/cursor.d.ts",
81
89
  "default": "./dist/cursor.js"
@@ -132,6 +140,10 @@
132
140
  "types": "./dist/passthrough.d.ts",
133
141
  "default": "./dist/passthrough.js"
134
142
  },
143
+ "./progress": {
144
+ "types": "./dist/progress.d.ts",
145
+ "default": "./dist/progress.js"
146
+ },
135
147
  "./reset": {
136
148
  "types": "./dist/reset.d.ts",
137
149
  "default": "./dist/reset.js"
@@ -1 +0,0 @@
1
- var n=Object.defineProperty;var r=(e,t)=>n(e,"name",{value:t,configurable:!0});var l=Object.defineProperty,i=r((e,t)=>l(e,"name",{value:t,configurable:!0}),"e");const o="auto",c=i(e=>e.toString(),"it2Cells"),s=i(e=>`${String(e)}px`,"it2Pixels"),P=i(e=>`${String(e)}%`,"it2Percent");export{o as IT2_AUTO,c as it2Cells,P as it2Percent,s as it2Pixels};
@@ -1 +0,0 @@
1
- var l=Object.defineProperty;var i=(t,e)=>l(t,"name",{value:e,configurable:!0});import{createRequire as a}from"node:module";const h=a(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=i(t=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,r]=s.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return s.getBuiltinModule(t)}return h(t)},"__cjs_getBuiltinModule"),{Buffer:p}=u("node:buffer");var c=Object.defineProperty,o=i((t,e)=>c(t,"name",{value:e,configurable:!0}),"t");const n=o(t=>{const e=[];return t.name&&e.push(`name=${t.name}`),t.size!==void 0&&e.push(`size=${String(t.size)}`),t.width!==void 0&&e.push(`width=${t.width.toString()}`),t.height!==void 0&&e.push(`height=${t.height.toString()}`),t.ignoreAspectRatio&&e.push("preserveAspectRatio=0"),t.inline&&e.push("inline=1"),t.doNotMoveCursor&&e.push("doNotMoveCursor=1"),e.join(";")},"formatITerm2FileProperties");class d{static{i(this,"ITerm2File")}static{o(this,"ITerm2File")}fileProps;constructor(e,r){if(this.fileProps={...e},r){if(r.byteLength>10*1024*1024)throw new Error("File size exceeds maximum limit of 10MB");if(this.fileProps.content=p.from(r).toString("base64"),this.fileProps.size??=r.byteLength,this.fileProps.size!==r.byteLength)throw new Error("File size property doesn't match actual data length")}}toString(){let e="File=";return e+=n(this.fileProps),this.fileProps.content!==void 0&&(e+=`:${this.fileProps.content}`),e}}class g{static{i(this,"ITerm2FileEnd")}static{o(this,"ITerm2FileEnd")}toString(){return"FileEnd"}}class F{static{i(this,"ITerm2FilePart")}constructor(e){this.base64Chunk=e}base64Chunk;static{o(this,"ITerm2FilePart")}toString(){return`FilePart=${this.base64Chunk}`}}class b{static{i(this,"ITerm2MultipartFileStart")}constructor(e){this.properties=e}properties;static{o(this,"ITerm2MultipartFileStart")}toString(){return`MultipartFile=${n(this.properties)}`}}export{d as ITerm2File,g as ITerm2FileEnd,F as ITerm2FilePart,b as ITerm2MultipartFileStart};
@@ -1 +0,0 @@
1
- const a="\x1B",s="\x1B[",x="\x1B]",B="\x07",S=";",C="\x1BP",E="\x1B\\";export{B,s as C,C as D,a as E,x as O,S,E as a};
@@ -1 +0,0 @@
1
- var u=Object.defineProperty;var t=(r,o)=>u(r,"name",{value:o,configurable:!0});import{C as s,S as i,E as e}from"./constants-D12jy2Zh.js";import"./restoreCursor-CHy0jZuu.js";const c=typeof globalThis<"u"&&typeof globalThis.window=="object"&&globalThis.window.document!==void 0,S=/^(?:msys|cygwin)$/,$=!c&&process.env.TERM_PROGRAM==="Apple_Terminal",E=!c&&(process.platform==="win32"||S.test(process.env.OSTYPE));var l=Object.defineProperty,a=t((r,o)=>l(r,"name",{value:o,configurable:!0}),"n");const g=`${e}7`,d=`${e}8`,O=`${s}A`,p=`${s}B`,U=`${s}C`,b=`${s}D`,k=`${s}6n`,v=`${s}?6n`,R=a((r=1)=>`${s}${String(r)}D`,"cursorBackward"),y=a((r=1)=>`${s}${String(r)}B`,"cursorDown"),A=a((r=1)=>`${s}${String(r)}C`,"cursorForward"),D=`${s}?25l`,f=`${s}G`,m=a((r=1)=>R(r),"cursorLeft"),C=a((r=1)=>`${s}${String(r)}G`,"cursorHorizontalAbsolute"),P=a((r,o)=>{let n="";return r<0?n+=`${s}${String(-r)}D`:r>0&&(n+=`${s}${String(r)}C`),o<0?n+=`${s}${String(-o)}A`:o>0&&(n+=`${s}${String(o)}B`),n},"cursorMove"),h=a((r=1)=>`${s}${String(r)}E`,"cursorNextLine"),H=a((r=1)=>`${s}${String(r)}F`,"cursorPreviousLine"),F=$?d:`${e}u`,I=$?g:`${e}s`,L=`${s}?25h`,N=a((r,o)=>o===void 0?C(r+1):`${s}${String(o+1)}${i}${String(r+1)}H`,"cursorTo"),z=a((r,o)=>o===void 0?`${s}${String(r)}H`:`${s}${String(r)}${i}${String(o)}H`,"cursorPosition"),x=a((r=1)=>`${s}${String(r)}I`,"cursorHorizontalForwardTab"),M=a((r=1)=>`${s}${String(r)}Z`,"cursorBackwardTab"),W=a((r=1)=>`${s}${String(r)}X`,"eraseCharacter"),j=a((r=1)=>`${s}${String(r)}d`,"cursorVerticalAbsolute"),G=a((r=1)=>`${s}${String(r)}A`,"cursorUp");var B=(r=>(r[r.Default=0]="Default",r[r.BlinkingBlock=1]="BlinkingBlock",r[r.SteadyBlock=2]="SteadyBlock",r[r.BlinkingUnderline=3]="BlinkingUnderline",r[r.SteadyUnderline=4]="SteadyUnderline",r[r.BlinkingBar=5]="BlinkingBar",r[r.SteadyBar=6]="SteadyBar",r))(B||{});const V=a(r=>`${s}${String(r)} q`,"setCursorStyle");export{E as A,B,b as C,k as R,g as S,p as a,U as b,O as c,v as d,d as e,R as f,M as g,y as h,A as i,D as j,C as k,x as l,m,P as n,h as o,z as p,H as q,F as r,I as s,L as t,N as u,f as v,G as w,j as x,W as y,V as z};
@@ -1 +0,0 @@
1
- var o=Object.defineProperty;var n=(r,t)=>o(r,"name",{value:t,configurable:!0});import{O as e,B as s}from"./constants-D12jy2Zh.js";var g=Object.defineProperty,a=n((r,t)=>g(r,"name",{value:t,configurable:!0}),"s");const m=`${e}9;4;0${s}`,B=a(r=>{const t=Math.min(Math.max(0,r),100);return`${e}9;4;1;${String(t)}${s}`},"setProgressBar"),P=a(r=>{const t=Math.min(Math.max(0,r),100);return`${e}9;4;2;${String(t)}${s}`},"setErrorProgressBar"),c=`${e}9;4;3${s}`,h=a(r=>{const t=Math.min(Math.max(0,r),100);return`${e}9;4;4;${String(t)}${s}`},"setWarningProgressBar");export{m as resetProgressBar,P as setErrorProgressBar,c as setIndeterminateProgressBar,B as setProgressBar,h as setWarningProgressBar};
@@ -1,2 +0,0 @@
1
- var _=Object.defineProperty;var s=(e,t)=>_(e,"name",{value:t,configurable:!0});import{createRequire as E}from"node:module";const B=E(import.meta.url),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=P;var I=Object.defineProperty,l=s((e,t)=>I(e,"name",{value:t,configurable:!0}),"r$2");const T=l((e,t,i,r)=>{if(i==="length"||i==="prototype"||i==="arguments"||i==="caller")return;const n=Object.getOwnPropertyDescriptor(e,i),o=Object.getOwnPropertyDescriptor(t,i);!v(n,o)&&r||Object.defineProperty(e,i,o)},"copyProperty"),v=l(function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},"canCopyProperty"),G=l((e,t)=>{const i=Object.getPrototypeOf(t);i!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,i)},"changePrototype"),j=l((e,t)=>`/* Wrapped ${e}*/
2
- ${t}`,"wrappedToString"),$=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),L=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),R=l((e,t,i)=>{const r=i===""?"":`with ${i.trim()}() `,n=j.bind(null,r,t.toString());Object.defineProperty(n,"name",L);const{writable:o,enumerable:u,configurable:m}=$;Object.defineProperty(e,"toString",{value:n,writable:o,enumerable:u,configurable:m})},"changeToString");function S(e,t,{ignoreNonConfigurable:i=!1}={}){const{name:r}=e;for(const n of Reflect.ownKeys(t))T(e,t,n,i);return G(e,t),R(e,t,r),e}s(S,"P");l(S,"mimicFunction");var C=Object.defineProperty,b=s((e,t)=>C(e,"name",{value:t,configurable:!0}),"a$1");const p=new WeakMap,w=b((e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let i,r=0;const n=e.displayName||e.name||"<anonymous>",o=b(function(...u){if(p.set(o,++r),r===1)i=e.apply(this,u),e=void 0;else if(t.throw===!0)throw new Error(`Function \`${n}\` can only be called once`);return i},"onetime");return S(o,e),p.set(o,r),o},"onetime");w.callCount=e=>{if(!p.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return p.get(e)};const a=[];a.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&a.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&a.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var F=Object.defineProperty,c=s((e,t)=>F(e,"name",{value:t,configurable:!0}),"r$1");const h=c(e=>!!e&&!0&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function","processOk"),d=Symbol.for("signal-exit emitter"),g=globalThis,k=Object.defineProperty.bind(Object);class U{static{s(this,"y")}static{c(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(g[d])return g[d];k(g,d,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,i){this.listeners[t].push(i)}removeListener(t,i){const r=this.listeners[t],n=r.indexOf(i);n!==-1&&(n===0&&r.length===1?r.length=0:r.splice(n,1))}emit(t,i,r){if(this.emitted[t])return!1;this.emitted[t]=!0;let n=!1;for(const o of this.listeners[t])n=o(i,r)===!0||n;return t==="exit"&&(n=this.emit("afterExit",i,r)||n),n}}class O{static{s(this,"c")}static{c(this,"SignalExitBase")}}const M=c(e=>({onExit(t,i){return e.onExit(t,i)},load(){return e.load()},unload(){return e.unload()}}),"signalExitWrap");class A extends O{static{s(this,"_")}static{c(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}}class D extends O{static{s(this,"p")}static{c(this,"SignalExit")}#s=y.platform==="win32"?"SIGINT":"SIGHUP";#e=new U;#t;#n;#o;#r={};#i=!1;constructor(t){super(),this.#t=t,this.#r={};for(const i of a)this.#r[i]=()=>{const r=this.#t.listeners(i);let{count:n}=this.#e;const o=t;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(n+=o.__signal_exit_emitter__.count),r.length===n){this.unload();const u=this.#e.emit("exit",null,i),m=i==="SIGHUP"?this.#s:i;u||t.kill(t.pid,m)}};this.#o=t.reallyExit,this.#n=t.emit}onExit(t,i){if(!h(this.#t))return()=>{};this.#i===!1&&this.load();const r=i?.alwaysLast?"afterExit":"exit";return this.#e.on(r,t),()=>{this.#e.removeListener(r,t),this.#e.listeners.exit.length===0&&this.#e.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#e.count+=1;for(const t of a)try{const i=this.#r[t];i&&this.#t.on(t,i)}catch{}this.#t.emit=(t,...i)=>this.#l(t,...i),this.#t.reallyExit=t=>this.#a(t)}}unload(){this.#i&&(this.#i=!1,a.forEach(t=>{const i=this.#r[t];if(!i)throw new Error("Listener not defined for signal: "+t);try{this.#t.removeListener(t,i)}catch{}}),this.#t.emit=this.#n,this.#t.reallyExit=this.#o,this.#e.count-=1)}#a(t){return h(this.#t)?(this.#t.exitCode=t||0,this.#e.emit("exit",this.#t.exitCode,null),this.#o.call(this.#t,this.#t.exitCode)):0}#l(t,...i){const r=this.#n;if(t==="exit"&&h(this.#t)){typeof i[0]=="number"&&(this.#t.exitCode=i[0]);const n=r.call(this.#t,t,...i);return this.#e.emit("exit",this.#t.exitCode,null),n}else return r.call(this.#t,t,...i)}}const y=globalThis.process,{onExit:N}=M(h(y)?new D(y):new A),x=f.stderr.isTTY?f.stderr:f.stdout.isTTY?f.stdout:void 0,H=x?w(()=>{N(()=>{x.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{};export{H as default};