@visulima/ansi 4.0.0-alpha.17 → 4.0.0-alpha.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/dist/background.d.ts +72 -0
- package/dist/background.js +1 -0
- package/dist/charset.d.ts +52 -0
- package/dist/charset.js +1 -0
- package/dist/constants.d.ts +8 -1
- package/dist/constants.js +1 -1
- package/dist/cwd.d.ts +26 -0
- package/dist/cwd.js +1 -0
- package/dist/finalterm.d.ts +47 -0
- package/dist/finalterm.js +1 -0
- package/dist/focus.d.ts +20 -0
- package/dist/focus.js +1 -0
- package/dist/hyperlink.d.ts +25 -0
- package/dist/hyperlink.js +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.js +1 -1
- package/dist/keypad.d.ts +27 -0
- package/dist/keypad.js +1 -0
- package/dist/kitty-graphics.d.ts +17 -0
- package/dist/kitty-graphics.js +1 -0
- package/dist/notification.d.ts +30 -0
- package/dist/notification.js +1 -0
- package/dist/paste.d.ts +23 -0
- package/dist/paste.js +1 -0
- package/dist/sixel.d.ts +19 -0
- package/dist/sixel.js +1 -0
- package/dist/title.js +1 -1
- package/dist/urxvt.d.ts +15 -0
- package/dist/urxvt.js +1 -0
- package/package.json +45 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
+
## @visulima/ansi [4.0.0-alpha.18](https://github.com/visulima/visulima/compare/@visulima/ansi@4.0.0-alpha.17...@visulima/ansi@4.0.0-alpha.18) (2026-06-30)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **ansi:** add bracketed paste markers ([5dc3d57](https://github.com/visulima/visulima/commit/5dc3d579cd1887c3b949ffee875d7259d8a5879e))
|
|
6
|
+
* **ansi:** add character set selection (SCS) ([60852bd](https://github.com/visulima/visulima/commit/60852bd00920dc90c582adc298584a13e4f361a8))
|
|
7
|
+
* **ansi:** add desktop notification sequences ([36f0a69](https://github.com/visulima/visulima/commit/36f0a69191e502750c7e104838688edd249e837e))
|
|
8
|
+
* **ansi:** add FinalTerm shell integration marks (OSC 133) ([e087278](https://github.com/visulima/visulima/commit/e087278a25f5665172cbaa3f4dacd628ebd344ba))
|
|
9
|
+
* **ansi:** add focus event reporting sequences ([83718f7](https://github.com/visulima/visulima/commit/83718f770c6e5297a69675f3adea2ba9004b95aa))
|
|
10
|
+
* **ansi:** add foreground/background/cursor color sequences ([2c562bd](https://github.com/visulima/visulima/commit/2c562bdfb3a67168fd106b78159b4e98d6131f47))
|
|
11
|
+
* **ansi:** add keypad application/numeric mode sequences ([cc62e9d](https://github.com/visulima/visulima/commit/cc62e9d21c7043df0b101c967133ae0b335e2d83))
|
|
12
|
+
* **ansi:** add kitty graphics protocol sequence wrapper ([6e83b5c](https://github.com/visulima/visulima/commit/6e83b5cff7938ae38df8d9aa6e019453c89ae1ea))
|
|
13
|
+
* **ansi:** add sixel graphics sequence wrapper ([fb2a225](https://github.com/visulima/visulima/commit/fb2a225d10ad6008e0cdc6959128d30502536c2f))
|
|
14
|
+
* **ansi:** add urxvt OSC 777 extension ([8b96c1a](https://github.com/visulima/visulima/commit/8b96c1ac11c19c56fa3a55adff21309ad2287b43))
|
|
15
|
+
* **ansi:** add working directory reporting (OSC 7) ([95059d5](https://github.com/visulima/visulima/commit/95059d5462a416393937d5bbab6ca425397a22b4))
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **ansi:** strip OSC terminators from color/cwd/finalterm payloads ([6c4ab8c](https://github.com/visulima/visulima/commit/6c4ab8c4cae3f8bafd7483f161887883bb315a6b))
|
|
20
|
+
|
|
21
|
+
### Documentation
|
|
22
|
+
|
|
23
|
+
* **ansi:** document new escape sequence modules ([0bbc476](https://github.com/visulima/visulima/commit/0bbc4766259d9bde491186cadeb167d9e353f4dc))
|
|
24
|
+
|
|
25
|
+
### Styles
|
|
26
|
+
|
|
27
|
+
* cs fixes ([2a960bb](https://github.com/visulima/visulima/commit/2a960bb1772c9dc70080e2d75d3a0d827034e294))
|
|
28
|
+
|
|
29
|
+
### Miscellaneous Chores
|
|
30
|
+
|
|
31
|
+
* add fallow code-intelligence across all packages ([a3b4821](https://github.com/visulima/visulima/commit/a3b48215002e86fed20f2973038b5d4a0aa1ce04))
|
|
32
|
+
* **fallow:** resolve dead-code findings ([c4125d5](https://github.com/visulima/visulima/commit/c4125d53e03ac9d90115399634535991927a96cc))
|
|
33
|
+
|
|
34
|
+
### Code Refactoring
|
|
35
|
+
|
|
36
|
+
* **ansi:** share OSC terminator sanitizer; address review findings ([ed2215d](https://github.com/visulima/visulima/commit/ed2215d8a61e2896dae278c7a07eae393ed415ea))
|
|
37
|
+
|
|
38
|
+
### Continuous Integration
|
|
39
|
+
|
|
40
|
+
* **fallow:** make fallow:health advisory (--report-only) ([d57148e](https://github.com/visulima/visulima/commit/d57148ea0e3556b4c24d8d336b9fa14987f5dc7d))
|
|
41
|
+
|
|
1
42
|
## @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
43
|
|
|
3
44
|
### Features
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a sequence that sets the terminal's default foreground (text) color.
|
|
3
|
+
*
|
|
4
|
+
* The color may be any string the terminal understands for `OSC 10`, such as an
|
|
5
|
+
* X11 color name (`"red"`), a hex value (`"#ff0000"`), or an `XParseColor`
|
|
6
|
+
* string (`"rgb:ff/00/00"`, `"rgba:ff/00/00/ff"`).
|
|
7
|
+
*
|
|
8
|
+
* Sequence: `OSC 10 ; color BEL`
|
|
9
|
+
* @param color The color to set the foreground to.
|
|
10
|
+
* @returns The `OSC 10` escape sequence.
|
|
11
|
+
* @see {@link https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands}
|
|
12
|
+
*/
|
|
13
|
+
declare const setForegroundColor: (color: string) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Sequence that queries the terminal's current default foreground color.
|
|
16
|
+
*
|
|
17
|
+
* Sequence: `OSC 10 ; ? BEL`
|
|
18
|
+
*/
|
|
19
|
+
declare const requestForegroundColor: string;
|
|
20
|
+
/**
|
|
21
|
+
* Sequence that resets the terminal's default foreground color to its default.
|
|
22
|
+
*
|
|
23
|
+
* Sequence: `OSC 110 BEL`
|
|
24
|
+
*/
|
|
25
|
+
declare const resetForegroundColor: string;
|
|
26
|
+
/**
|
|
27
|
+
* Returns a sequence that sets the terminal's default background color.
|
|
28
|
+
*
|
|
29
|
+
* The color may be any string the terminal understands for `OSC 11` (X11 color
|
|
30
|
+
* name, hex value, or `XParseColor` string).
|
|
31
|
+
*
|
|
32
|
+
* Sequence: `OSC 11 ; color BEL`
|
|
33
|
+
* @param color The color to set the background to.
|
|
34
|
+
* @returns The `OSC 11` escape sequence.
|
|
35
|
+
*/
|
|
36
|
+
declare const setBackgroundColor: (color: string) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Sequence that queries the terminal's current default background color.
|
|
39
|
+
*
|
|
40
|
+
* Sequence: `OSC 11 ; ? BEL`
|
|
41
|
+
*/
|
|
42
|
+
declare const requestBackgroundColor: string;
|
|
43
|
+
/**
|
|
44
|
+
* Sequence that resets the terminal's default background color to its default.
|
|
45
|
+
*
|
|
46
|
+
* Sequence: `OSC 111 BEL`
|
|
47
|
+
*/
|
|
48
|
+
declare const resetBackgroundColor: string;
|
|
49
|
+
/**
|
|
50
|
+
* Returns a sequence that sets the terminal's cursor color.
|
|
51
|
+
*
|
|
52
|
+
* The color may be any string the terminal understands for `OSC 12` (X11 color
|
|
53
|
+
* name, hex value, or `XParseColor` string).
|
|
54
|
+
*
|
|
55
|
+
* Sequence: `OSC 12 ; color BEL`
|
|
56
|
+
* @param color The color to set the cursor to.
|
|
57
|
+
* @returns The `OSC 12` escape sequence.
|
|
58
|
+
*/
|
|
59
|
+
declare const setCursorColor: (color: string) => string;
|
|
60
|
+
/**
|
|
61
|
+
* Sequence that queries the terminal's current cursor color.
|
|
62
|
+
*
|
|
63
|
+
* Sequence: `OSC 12 ; ? BEL`
|
|
64
|
+
*/
|
|
65
|
+
declare const requestCursorColor: string;
|
|
66
|
+
/**
|
|
67
|
+
* Sequence that resets the terminal's cursor color to its default.
|
|
68
|
+
*
|
|
69
|
+
* Sequence: `OSC 112 BEL`
|
|
70
|
+
*/
|
|
71
|
+
declare const resetCursorColor: string;
|
|
72
|
+
export { requestBackgroundColor, requestCursorColor, requestForegroundColor, resetBackgroundColor, resetCursorColor, resetForegroundColor, setBackgroundColor, setCursorColor, setForegroundColor };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{OSC as r,BEL as o,stripOscTerminators as e}from"./constants.js";const t=$=>`${r}10;${e($)}${o}`,C=`${r}10;?${o}`,u=`${r}110${o}`,l=$=>`${r}11;${e($)}${o}`,n=`${r}11;?${o}`,d=`${r}111${o}`,g=$=>`${r}12;${e($)}${o}`,c=`${r}12;?${o}`,a=`${r}112${o}`;export{n as requestBackgroundColor,c as requestCursorColor,C as requestForegroundColor,d as resetBackgroundColor,a as resetCursorColor,u as resetForegroundColor,l as setBackgroundColor,g as setCursorColor,t as setForegroundColor};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a Select Character Set (SCS) sequence that designates `charset` into
|
|
3
|
+
* one of the G0–G3 character-set slots.
|
|
4
|
+
*
|
|
5
|
+
* `gset` is one of the designator characters (see {@link G0}, {@link G1},
|
|
6
|
+
* {@link G2}, {@link G3} for 94-character sets, or `"-"`, `"."`, `"/"` for the
|
|
7
|
+
* 96-character G1–G3 slots). `charset` selects the final character of the set,
|
|
8
|
+
* e.g. {@link USASCII} (`"B"`), {@link DEC_SPECIAL_GRAPHICS} (`"0"`) or
|
|
9
|
+
* {@link UNITED_KINGDOM} (`"A"`).
|
|
10
|
+
*
|
|
11
|
+
* Sequence: `ESC gset charset`
|
|
12
|
+
* @param gset The G-set designator character.
|
|
13
|
+
* @param charset The final character identifying the character set.
|
|
14
|
+
* @returns The SCS escape sequence.
|
|
15
|
+
* @see {@link https://vt100.net/docs/vt510-rm/SCS.html}
|
|
16
|
+
*/
|
|
17
|
+
declare const selectCharacterSet: (gset: string, charset: string) => string;
|
|
18
|
+
/** Alias for {@link selectCharacterSet} (Select Character Set). */
|
|
19
|
+
declare const SCS: typeof selectCharacterSet;
|
|
20
|
+
/** G0 designator for a 94-character set. */
|
|
21
|
+
declare const G0: string;
|
|
22
|
+
/** G1 designator for a 94-character set. */
|
|
23
|
+
declare const G1: string;
|
|
24
|
+
/** G2 designator for a 94-character set. */
|
|
25
|
+
declare const G2: string;
|
|
26
|
+
/** G3 designator for a 94-character set. */
|
|
27
|
+
declare const G3: string;
|
|
28
|
+
/** DEC Special Character and Line Drawing Set (final character `0`). */
|
|
29
|
+
declare const DEC_SPECIAL_GRAPHICS: string;
|
|
30
|
+
/** United Kingdom character set (final character `A`). */
|
|
31
|
+
declare const UNITED_KINGDOM: string;
|
|
32
|
+
/** United States (USASCII) character set (final character `B`). */
|
|
33
|
+
declare const USASCII: string;
|
|
34
|
+
/** Locking Shift 0 (LS0 / SI): invoke G0 into GL. Sequence: `SI` (`\u000F`). */
|
|
35
|
+
declare const LS0: string;
|
|
36
|
+
/** Alias for {@link LS0} (Shift In). */
|
|
37
|
+
declare const SI: string;
|
|
38
|
+
/** Locking Shift 1 (LS1 / SO): invoke G1 into GL. Sequence: `SO` (`\u000E`). */
|
|
39
|
+
declare const LS1: string;
|
|
40
|
+
/** Alias for {@link LS1} (Shift Out). */
|
|
41
|
+
declare const SO: string;
|
|
42
|
+
/** Locking Shift 1 Right (LS1R): invoke G1 into GR. Sequence: `ESC ~`. */
|
|
43
|
+
declare const LS1R: string;
|
|
44
|
+
/** Locking Shift 2 (LS2): invoke G2 into GL. Sequence: `ESC n`. */
|
|
45
|
+
declare const LS2: string;
|
|
46
|
+
/** Locking Shift 2 Right (LS2R): invoke G2 into GR. Sequence: `ESC }`. */
|
|
47
|
+
declare const LS2R: string;
|
|
48
|
+
/** Locking Shift 3 (LS3): invoke G3 into GL. Sequence: `ESC o`. */
|
|
49
|
+
declare const LS3: string;
|
|
50
|
+
/** Locking Shift 3 Right (LS3R): invoke G3 into GR. Sequence: `ESC |`. */
|
|
51
|
+
declare const LS3R: string;
|
|
52
|
+
export { DEC_SPECIAL_GRAPHICS, G0, G1, G2, G3, LS0, LS1, LS1R, LS2, LS2R, LS3, LS3R, SCS, SI, SO, UNITED_KINGDOM, USASCII, selectCharacterSet };
|
package/dist/charset.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ESC as S}from"./constants.js";const C=(L,$)=>`${S}${L}${$}`,e=C,o="(",r=")",A="*",E="+",R="0",c="A",D="B",I="",_=I,t="",a=t,m=`${S}~`,n=`${S}n`,p=`${S}}`,s=`${S}o`,N=`${S}|`;export{R as DEC_SPECIAL_GRAPHICS,o as G0,r as G1,A as G2,E as G3,I as LS0,t as LS1,m as LS1R,n as LS2,p as LS2R,s as LS3,N as LS3R,e as SCS,_ as SI,a as SO,c as UNITED_KINGDOM,D as USASCII,C as selectCharacterSet};
|
package/dist/constants.d.ts
CHANGED
|
@@ -18,4 +18,11 @@ declare const APC: string;
|
|
|
18
18
|
declare const SOS: string;
|
|
19
19
|
/** Privacy Message (ESC ^). */
|
|
20
20
|
declare const PM: string;
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Strips OSC terminators (BEL, ESC) from a caller-supplied value so it cannot
|
|
23
|
+
* inject or prematurely terminate an escape sequence when interpolated into one.
|
|
24
|
+
* @param value The untrusted string to sanitize.
|
|
25
|
+
* @returns `value` with all BEL and ESC characters removed.
|
|
26
|
+
*/
|
|
27
|
+
declare const stripOscTerminators: (value: string) => string;
|
|
28
|
+
export { APC, BEL, CSI, DCS, ESC, OSC, PM, SEP, SOS, ST, stripOscTerminators };
|
package/dist/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const B="\x1B",S="\x1B[",r="\x1B]",C="\x07",e=";",s="\x1BP",t="\x1B\\",P="\x1B_",c="\x1BX",l="\x1B^",o=x=>x.replaceAll(/[\u0007\u001B]/g,"");export{P as APC,C as BEL,S as CSI,s as DCS,B as ESC,r as OSC,l as PM,e as SEP,c as SOS,t as ST,o as stripOscTerminators};
|
package/dist/cwd.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a sequence that reports the current working directory to the terminal.
|
|
3
|
+
*
|
|
4
|
+
* Terminals such as iTerm2, WezTerm and others use this `OSC 7` sequence to keep
|
|
5
|
+
* track of the shell's working directory — for example to open new tabs/splits in
|
|
6
|
+
* the same directory. The payload is a `file://` URL built from the optional
|
|
7
|
+
* `host` and the joined `paths`.
|
|
8
|
+
*
|
|
9
|
+
* Sequence: `OSC 7 ; file://[host]/[path] BEL`
|
|
10
|
+
* @param host The host portion of the `file://` URL (use an empty string for the local machine).
|
|
11
|
+
* @param paths One or more path segments that are joined into the URL path.
|
|
12
|
+
* @returns The `OSC 7` escape sequence.
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { notifyWorkingDirectory } from "@visulima/ansi/cwd";
|
|
16
|
+
*
|
|
17
|
+
* process.stdout.write(notifyWorkingDirectory("", process.cwd()));
|
|
18
|
+
* ```
|
|
19
|
+
* @see {@link https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/20}
|
|
20
|
+
*/
|
|
21
|
+
declare const notifyWorkingDirectory: (host: string, ...paths: string[]) => string;
|
|
22
|
+
/**
|
|
23
|
+
* Alias for {@link notifyWorkingDirectory}.
|
|
24
|
+
*/
|
|
25
|
+
declare const setWorkingDirectory: (host: string, ...paths: string[]) => string;
|
|
26
|
+
export { notifyWorkingDirectory, setWorkingDirectory };
|
package/dist/cwd.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{stripOscTerminators as s,OSC as c,BEL as l}from"./constants.js";const $=(t,...o)=>{const r=o.filter(n=>n.length>0).join("/").replaceAll(/\/{2,}/g,"/"),e=r.startsWith("/")?r:`/${r}`,i=s(t);return`${c}7;file://${i}${encodeURI(e)}${l}`},g=$;export{$ as notifyWorkingDirectory,g as setWorkingDirectory};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a FinalTerm shell-integration sequence (`OSC 133`).
|
|
3
|
+
*
|
|
4
|
+
* The FinalTerm protocol lets shells mark the structure of their output — where
|
|
5
|
+
* the prompt starts, where the user's command begins, where its output starts
|
|
6
|
+
* and when it finished — so terminals can offer features like jump-to-prompt,
|
|
7
|
+
* command status and selection of command output.
|
|
8
|
+
*
|
|
9
|
+
* Sequence: `OSC 133 ; Pt BEL`
|
|
10
|
+
* @param pm The semicolon-delimited parameters of the sequence.
|
|
11
|
+
* @returns The `OSC 133` escape sequence.
|
|
12
|
+
* @see {@link https://iterm2.com/documentation-shell-integration.html}
|
|
13
|
+
*/
|
|
14
|
+
declare const finalTerm: (...pm: string[]) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Marks the start of the shell prompt. Sent just before the prompt is printed.
|
|
17
|
+
*
|
|
18
|
+
* Sequence: `OSC 133 ; A ; Pt BEL`
|
|
19
|
+
* @param pm Additional parameters appended after the `A` marker.
|
|
20
|
+
* @returns The `OSC 133 ; A` escape sequence.
|
|
21
|
+
*/
|
|
22
|
+
declare const finalTermPrompt: (...pm: string[]) => string;
|
|
23
|
+
/**
|
|
24
|
+
* Marks the end of the prompt and the start of the user's command input.
|
|
25
|
+
*
|
|
26
|
+
* Sequence: `OSC 133 ; B ; Pt BEL`
|
|
27
|
+
* @param pm Additional parameters appended after the `B` marker.
|
|
28
|
+
* @returns The `OSC 133 ; B` escape sequence.
|
|
29
|
+
*/
|
|
30
|
+
declare const finalTermCmdStart: (...pm: string[]) => string;
|
|
31
|
+
/**
|
|
32
|
+
* Marks the start of the command output (the command is about to be executed).
|
|
33
|
+
*
|
|
34
|
+
* Sequence: `OSC 133 ; C ; Pt BEL`
|
|
35
|
+
* @param pm Additional parameters appended after the `C` marker.
|
|
36
|
+
* @returns The `OSC 133 ; C` escape sequence.
|
|
37
|
+
*/
|
|
38
|
+
declare const finalTermCmdExecuted: (...pm: string[]) => string;
|
|
39
|
+
/**
|
|
40
|
+
* Marks the end of the command output. May carry the command's exit code.
|
|
41
|
+
*
|
|
42
|
+
* Sequence: `OSC 133 ; D ; Pt BEL`
|
|
43
|
+
* @param pm Additional parameters appended after the `D` marker (e.g. the exit code).
|
|
44
|
+
* @returns The `OSC 133 ; D` escape sequence.
|
|
45
|
+
*/
|
|
46
|
+
declare const finalTermCmdFinished: (...pm: string[]) => string;
|
|
47
|
+
export { finalTerm, finalTermCmdExecuted, finalTermCmdFinished, finalTermCmdStart, finalTermPrompt };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{OSC as e,BEL as n,stripOscTerminators as t}from"./constants.js";const r=(...m)=>`${e}133;${m.map(i=>t(i)).join(";")}${n}`,o=(...m)=>r("A",...m),f=(...m)=>r("B",...m),T=(...m)=>r("C",...m),d=(...m)=>r("D",...m);export{r as finalTerm,T as finalTermCmdExecuted,d as finalTermCmdFinished,f as finalTermCmdStart,o as finalTermPrompt};
|
package/dist/focus.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event a terminal emits when the window gains focus, while focus event
|
|
3
|
+
* reporting is enabled (DEC private mode 1004).
|
|
4
|
+
*
|
|
5
|
+
* Sequence: `CSI I`
|
|
6
|
+
* @see {@link https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Focus-Tracking}
|
|
7
|
+
*/
|
|
8
|
+
declare const FOCUS: string;
|
|
9
|
+
/**
|
|
10
|
+
* Event a terminal emits when the window loses focus, while focus event
|
|
11
|
+
* reporting is enabled (DEC private mode 1004).
|
|
12
|
+
*
|
|
13
|
+
* Sequence: `CSI O`
|
|
14
|
+
*/
|
|
15
|
+
declare const BLUR: string;
|
|
16
|
+
/** Alias for {@link FOCUS}. */
|
|
17
|
+
declare const focusInEvent: string;
|
|
18
|
+
/** Alias for {@link BLUR}. */
|
|
19
|
+
declare const focusOutEvent: string;
|
|
20
|
+
export { BLUR, FOCUS, focusInEvent, focusOutEvent };
|
package/dist/focus.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CSI as o}from"./constants.js";const t=`${o}I`,n=`${o}O`,e=t,f=n;export{n as BLUR,t as FOCUS,e as focusInEvent,f as focusOutEvent};
|
package/dist/hyperlink.d.ts
CHANGED
|
@@ -1,2 +1,27 @@
|
|
|
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
|
+
*/
|
|
1
26
|
declare const hyperlink: (text: string, url: string) => string;
|
|
2
27
|
export { hyperlink as default };
|
package/dist/hyperlink.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{OSC as
|
|
1
|
+
import{stripOscTerminators as r,OSC as t,SEP as o,BEL as s}from"./constants.js";const m=(n,a)=>{const c=r(a),e=r(n);return[t,"8",o,o,c,s,e,t,"8",o,o,s].join("")};export{m as default};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
export { ALT_SCREEN_OFF, ALT_SCREEN_ON, alternativeScreenOff, alternativeScreenOn } from "./alternative-screen.js";
|
|
2
|
+
export { requestBackgroundColor, requestCursorColor, requestForegroundColor, resetBackgroundColor, resetCursorColor, resetForegroundColor, setBackgroundColor, setCursorColor, setForegroundColor } from "./background.js";
|
|
3
|
+
export { DEC_SPECIAL_GRAPHICS, G0, G1, G2, G3, LS0, LS1, LS1R, LS2, LS2R, LS3, LS3R, SCS, SI, SO, UNITED_KINGDOM, USASCII, selectCharacterSet } from "./charset.js";
|
|
2
4
|
export { clearLineAndHomeCursor, clearScreenAndHomeCursor, clearScreenFromTopLeft, resetTerminal } from "./clear.js";
|
|
3
5
|
export { type ClipboardSelection, clearClipboard, requestClipboard, setClipboard } from "./clipboard.js";
|
|
4
6
|
export { APC, BEL, CSI, DCS, ESC, OSC, PM, SEP, SOS, ST } from "./constants.js";
|
|
5
7
|
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";
|
|
8
|
+
export { notifyWorkingDirectory, setWorkingDirectory } from "./cwd.js";
|
|
6
9
|
export { type EraseDisplayMode, type EraseLineMode, eraseDisplay, eraseDown, eraseInLine, eraseLine, eraseLineEnd, eraseLineStart, eraseLines, eraseScreen, eraseScreenAndScrollback, eraseUp } from "./erase.js";
|
|
10
|
+
export { finalTerm, finalTermCmdExecuted, finalTermCmdFinished, finalTermCmdStart, finalTermPrompt } from "./finalterm.js";
|
|
11
|
+
export { BLUR, FOCUS, focusInEvent, focusOutEvent } from "./focus.js";
|
|
7
12
|
export { default as hyperlink } from "./hyperlink.js";
|
|
8
13
|
export { type ImageOptions, image } from "./image.js";
|
|
9
14
|
export { type IITerm2Payload, IT2_AUTO, ITerm2File, ITerm2FileEnd, ITerm2FilePart, type ITerm2FileProperties, ITerm2MultipartFileStart, iTerm2, it2Cells, it2Percent, it2Pixels } from "./iterm2.js";
|
|
15
|
+
export { DECKPAM, DECKPNM, keypadApplicationMode, keypadNumericMode } from "./keypad.js";
|
|
16
|
+
export { default as kittyGraphics } from "./kitty-graphics.js";
|
|
10
17
|
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";
|
|
11
18
|
export { MouseButton, type MouseButtonType, type MouseModifiers, disableAnyEventMouse, disableButtonEventMouse, disableFocusTracking, disableNormalMouse, disableSgrMouse, disableX10Mouse, enableAnyEventMouse, enableButtonEventMouse, enableFocusTracking, enableNormalMouse, enableSgrMouse, enableX10Mouse, encodeMouseButtonByte, mouseSgrSequence, mouseX10Sequence } from "./mouse.js";
|
|
19
|
+
export { desktopNotification, notify } from "./notification.js";
|
|
12
20
|
export { SCREEN_MAX_LEN_DEFAULT, SCREEN_TYPICAL_LIMIT, screenPassthrough, tmuxPassthrough } from "./passthrough.js";
|
|
21
|
+
export { bracketedPasteEnd, bracketedPasteStart, wrapBracketedPaste } from "./paste.js";
|
|
13
22
|
export { resetProgressBar, setErrorProgressBar, setIndeterminateProgressBar, setProgressBar, setWarningProgressBar } from "./progress.js";
|
|
14
23
|
export { RESET_INITIAL_STATE, RIS } from "./reset.js";
|
|
15
24
|
export { clearTabStop, deleteCharacter, deleteLine, insertCharacter, insertLine, repeatPreviousCharacter, requestPresentationStateReport, setLeftRightMargins, setTopBottomMargins } from "./screen.js";
|
|
16
25
|
export { SCROLL_DOWN_1, SCROLL_UP_1, scrollDown, scrollUp } from "./scroll.js";
|
|
26
|
+
export { default as sixelGraphics } from "./sixel.js";
|
|
17
27
|
export { type AnsiStatusReport, CPR, DA1, DA2, DA3, DECXCPR, DSR, DSR_KeyboardLanguageDEC, DSR_PrinterStatusDEC, DSR_TerminalStatus, DSR_UDKStatusDEC, type DecStatusReport, LightDarkReport, RequestLightDarkReport, RequestNameVersion, type StatusReport, XTVERSION, createAnsiStatusReport, createDecStatusReport, cursorPositionReport, deviceStatusReport, extendedCursorPositionReport, reportKeyboardLanguageDEC, reportPrimaryDeviceAttributes, reportPrinterNoPaperDEC, reportPrinterNotReadyDEC, reportPrinterReadyDEC, reportSecondaryDeviceAttributes, reportTerminalNotOK, reportTerminalOK, reportTertiaryDeviceAttributes, reportUDKLockedDEC, reportUDKUnlockedDEC, requestCursorPositionReport, requestExtendedCursorPositionReport, requestKeyboardLanguageDEC, requestPrimaryDeviceAttributes, requestPrimaryDeviceAttributesParam0, requestPrinterStatusDEC, requestSecondaryDeviceAttributes, requestSecondaryDeviceAttributesParam0, requestTerminalStatus, requestTertiaryDeviceAttributes, requestTertiaryDeviceAttributesParam0, requestUDKStatusDEC } from "./status.js";
|
|
18
28
|
export { default as strip } from "./strip.js";
|
|
19
29
|
export { XTGETTCAP, requestTermcap, requestTerminfo } from "./termcap.js";
|
|
20
30
|
export { decsin, decswt, setIconName, setIconNameAndWindowTitle, setIconNameAndWindowTitleWithST, setIconNameWithST, setWindowTitle, setWindowTitleWithST } from "./title.js";
|
|
31
|
+
export { default as urxvtExtension } from "./urxvt.js";
|
|
21
32
|
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";
|
|
22
33
|
export { KittyKeyboardFlag, type KittyKeyboardFlags, XTMODKEYS, XTQMODKEYS, keyModifierOptions, popKittyKeyboard, pushKittyKeyboard, queryKeyModifierOptions, queryKittyKeyboard, queryModifyOtherKeys, resetKeyModifierOptions, resetModifyOtherKeys, setKeyModifierOptions, setKittyKeyboard, setModifyOtherKeys1, setModifyOtherKeys2 } from "./xterm.js";
|
|
23
34
|
import 'type-fest';
|
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{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};
|
|
1
|
+
import{ALT_SCREEN_OFF as t,ALT_SCREEN_ON as s,alternativeScreenOff as a,alternativeScreenOn as i}from"./alternative-screen.js";import{requestBackgroundColor as d,requestCursorColor as u,requestForegroundColor as c,resetBackgroundColor as S,resetCursorColor as p,resetForegroundColor as l,setBackgroundColor as R,setCursorColor as M,setForegroundColor as C}from"./background.js";import{DEC_SPECIAL_GRAPHICS as E,G0 as D,G1 as f,G2 as T,G3 as y,LS0 as P,LS1 as x,LS1R as L,LS2 as A,LS2R as b,LS3 as O,LS3R as I,SCS as _,SI as g,SO as q,UNITED_KINGDOM as K,USASCII as N,selectCharacterSet as h}from"./charset.js";import{clearLineAndHomeCursor as v,clearScreenAndHomeCursor as B,clearScreenFromTopLeft as U,resetTerminal as k}from"./clear.js";import{clearClipboard as F,requestClipboard as z,setClipboard as X}from"./clipboard.js";import{APC as H,BEL as Q,CSI as V,DCS as Y,ESC as j,OSC as J,PM as Z,SEP as $,SOS as ee,ST as re}from"./constants.js";import{C as te,a as se,b as ae,c as ie,R as ne,d as de,e as ue,S as ce,f as Se,g as pe,h as le,i as Re,j as Me,k as Ce,l as me,m as Ee,n as De,o as fe,p as Te,q as ye,r as Pe,s as xe,t as Le,u as Ae,v as be,w as Oe,x as Ie,y as _e,z as ge}from"./packem_shared/cursor-BXG1O_IE.js";import{notifyWorkingDirectory as Ke,setWorkingDirectory as Ne}from"./cwd.js";import{eraseDisplay as we,eraseDown as ve,eraseInLine as Be,eraseLine as Ue,eraseLineEnd as ke,eraseLineStart as We,eraseLines as Fe,eraseScreen as ze,eraseScreenAndScrollback as Xe,eraseUp as Ge}from"./erase.js";import{finalTerm as Qe,finalTermCmdExecuted as Ve,finalTermCmdFinished as Ye,finalTermCmdStart as je,finalTermPrompt as Je}from"./finalterm.js";import{BLUR as $e,FOCUS as er,focusInEvent as rr,focusOutEvent as or}from"./focus.js";import{default as sr}from"./hyperlink.js";import{image as ir}from"./image.js";import{iTerm2 as dr}from"./iterm2.js";import{DECKPAM as cr,DECKPNM as Sr,keypadApplicationMode as pr,keypadNumericMode as lr}from"./keypad.js";import{default as Mr}from"./kitty-graphics.js";import{BDSM as mr,BiDirectionalSupportMode as Er,BracketedPasteMode as Dr,DECRPM as fr,DECRQM as Tr,DisableModifiersMode as yr,IRM as Pr,InBandResizeMode as xr,InsertReplaceMode as Lr,KAM as Ar,KeyboardActionMode as br,LNM as Or,LightDarkMode as Ir,LineFeedNewLineMode as _r,LocalEchoMode as gr,OriginMode as qr,RM as Kr,RequestBiDirectionalSupportMode as Nr,RequestInBandResizeMode as hr,RequestInsertReplaceMode as wr,RequestKeyboardActionMode as vr,RequestLineFeedNewLineMode as Br,RequestLocalEchoMode as Ur,RequestSendReceiveMode as kr,RequestUnicodeCoreMode as Wr,ResetBiDirectionalSupportMode as Fr,ResetInBandResizeMode as zr,ResetInsertReplaceMode as Xr,ResetKeyboardActionMode as Gr,ResetLineFeedNewLineMode as Hr,ResetLocalEchoMode as Qr,ResetSendReceiveMode as Vr,ResetUnicodeCoreMode as Yr,SGRMouseMode as jr,SM as Jr,SRM as Zr,SendFocusEventsMode as $r,SendReceiveMode as eo,SetBiDirectionalSupportMode as ro,SetInBandResizeMode as oo,SetInsertReplaceMode as to,SetKeyboardActionMode as so,SetLineFeedNewLineMode as ao,SetLocalEchoMode as io,SetSendReceiveMode as no,SetUnicodeCoreMode as uo,TextCursorEnableMode as co,UnicodeCoreMode as So,createAnsiMode as po,createDecMode as lo,isModeNotRecognized as Ro,isModePermanentlyReset as Mo,isModePermanentlySet as Co,isModeReset as mo,isModeSet as Eo,reportMode as Do,requestMode as fo,resetMode as To,setMode as yo}from"./mode.js";import{MouseButton as xo,disableAnyEventMouse as Lo,disableButtonEventMouse as Ao,disableFocusTracking as bo,disableNormalMouse as Oo,disableSgrMouse as Io,disableX10Mouse as _o,enableAnyEventMouse as go,enableButtonEventMouse as qo,enableFocusTracking as Ko,enableNormalMouse as No,enableSgrMouse as ho,enableX10Mouse as wo,encodeMouseButtonByte as vo,mouseSgrSequence as Bo,mouseX10Sequence as Uo}from"./mouse.js";import{desktopNotification as Wo,notify as Fo}from"./notification.js";import{SCREEN_MAX_LEN_DEFAULT as Xo,SCREEN_TYPICAL_LIMIT as Go,screenPassthrough as Ho,tmuxPassthrough as Qo}from"./passthrough.js";import{bracketedPasteEnd as Yo,bracketedPasteStart as jo,wrapBracketedPaste as Jo}from"./paste.js";import{resetProgressBar as $o,setErrorProgressBar as et,setIndeterminateProgressBar as rt,setProgressBar as ot,setWarningProgressBar as tt}from"./progress.js";import{RESET_INITIAL_STATE as at,RIS as it}from"./reset.js";import{clearTabStop as dt,deleteCharacter as ut,deleteLine as ct,insertCharacter as St,insertLine as pt,repeatPreviousCharacter as lt,requestPresentationStateReport as Rt,setLeftRightMargins as Mt,setTopBottomMargins as Ct}from"./screen.js";import{SCROLL_DOWN_1 as Et,SCROLL_UP_1 as Dt,scrollDown as ft,scrollUp as Tt}from"./scroll.js";import{default as Pt}from"./sixel.js";import{CPR as Lt,DA1 as At,DA2 as bt,DA3 as Ot,DECXCPR as It,DSR as _t,DSR_KeyboardLanguageDEC as gt,DSR_PrinterStatusDEC as qt,DSR_TerminalStatus as Kt,DSR_UDKStatusDEC as Nt,LightDarkReport as ht,RequestLightDarkReport as wt,RequestNameVersion as vt,XTVERSION as Bt,createAnsiStatusReport as Ut,createDecStatusReport as kt,cursorPositionReport as Wt,deviceStatusReport as Ft,extendedCursorPositionReport as zt,reportKeyboardLanguageDEC as Xt,reportPrimaryDeviceAttributes as Gt,reportPrinterNoPaperDEC as Ht,reportPrinterNotReadyDEC as Qt,reportPrinterReadyDEC as Vt,reportSecondaryDeviceAttributes as Yt,reportTerminalNotOK as jt,reportTerminalOK as Jt,reportTertiaryDeviceAttributes as Zt,reportUDKLockedDEC as $t,reportUDKUnlockedDEC as es,requestCursorPositionReport as rs,requestExtendedCursorPositionReport as os,requestKeyboardLanguageDEC as ts,requestPrimaryDeviceAttributes as ss,requestPrimaryDeviceAttributesParam0 as as,requestPrinterStatusDEC as is,requestSecondaryDeviceAttributes as ns,requestSecondaryDeviceAttributesParam0 as ds,requestTerminalStatus as us,requestTertiaryDeviceAttributes as cs,requestTertiaryDeviceAttributesParam0 as Ss,requestUDKStatusDEC as ps}from"./status.js";import{default as Rs}from"./strip.js";import{XTGETTCAP as Cs,requestTermcap as ms,requestTerminfo as Es}from"./termcap.js";import{decsin as fs,decswt as Ts,setIconName as ys,setIconNameAndWindowTitle as Ps,setIconNameAndWindowTitleWithST as xs,setIconNameWithST as Ls,setWindowTitle as As,setWindowTitleWithST as bs}from"./title.js";import{default as Is}from"./urxvt.js";import{XTWINOPS as gs,deiconifyWindow as qs,iconifyWindow as Ks,lowerWindow as Ns,maximizeWindow as hs,moveWindow as ws,raiseWindow as vs,refreshWindow as Bs,reportWindowPosition as Us,reportWindowState as ks,requestCellSizePixels as Ws,requestTextAreaSizeChars as Fs,requestTextAreaSizePixels as zs,resizeTextAreaChars as Xs,resizeTextAreaPixels as Gs,restoreMaximizedWindow as Hs,setPageSizeLines as Qs,xtermWindowOp as Vs}from"./window-ops.js";import{KittyKeyboardFlag as js,XTMODKEYS as Js,XTQMODKEYS as Zs,keyModifierOptions as $s,popKittyKeyboard as ea,pushKittyKeyboard as ra,queryKeyModifierOptions as oa,queryKittyKeyboard as ta,queryModifyOtherKeys as sa,resetKeyModifierOptions as aa,resetModifyOtherKeys as ia,setKeyModifierOptions as na,setKittyKeyboard as da,setModifyOtherKeys1 as ua,setModifyOtherKeys2 as ca}from"./xterm.js";import{IT2_AUTO as pa,it2Cells as la,it2Percent as Ra,it2Pixels as Ma}from"./packem_shared/IT2_AUTO-K3GubKy7.js";import{ITerm2File as ma,ITerm2FileEnd as Ea,ITerm2FilePart as Da,ITerm2MultipartFileStart as fa}from"./packem_shared/ITerm2File-BkLc5ipB.js";const e="\x07";export{t as ALT_SCREEN_OFF,s as ALT_SCREEN_ON,H as APC,mr as BDSM,Q as BEL,$e as BLUR,Er as BiDirectionalSupportMode,Dr as BracketedPasteMode,Lt as CPR,V as CSI,te as CURSOR_BACKWARD_1,se as CURSOR_DOWN_1,ae as CURSOR_FORWARD_1,ie as CURSOR_UP_1,At as DA1,bt as DA2,Ot as DA3,Y as DCS,cr as DECKPAM,Sr as DECKPNM,fr as DECRPM,Tr as DECRQM,It as DECXCPR,E as DEC_SPECIAL_GRAPHICS,_t as DSR,gt as DSR_KeyboardLanguageDEC,qt as DSR_PrinterStatusDEC,Kt as DSR_TerminalStatus,Nt as DSR_UDKStatusDEC,yr as DisableModifiersMode,j as ESC,er as FOCUS,D as G0,f as G1,T as G2,y as G3,Pr as IRM,pa as IT2_AUTO,ma as ITerm2File,Ea as ITerm2FileEnd,Da as ITerm2FilePart,fa as ITerm2MultipartFileStart,xr as InBandResizeMode,Lr as InsertReplaceMode,Ar as KAM,br as KeyboardActionMode,js as KittyKeyboardFlag,Or as LNM,P as LS0,x as LS1,L as LS1R,A as LS2,b as LS2R,O as LS3,I as LS3R,Ir as LightDarkMode,ht as LightDarkReport,_r as LineFeedNewLineMode,gr as LocalEchoMode,xo as MouseButton,J as OSC,qr as OriginMode,Z as PM,ne as REQUEST_CURSOR_POSITION,de as REQUEST_EXTENDED_CURSOR_POSITION,at as RESET_INITIAL_STATE,ue as RESTORE_CURSOR_DEC,it as RIS,Kr as RM,Nr as RequestBiDirectionalSupportMode,hr as RequestInBandResizeMode,wr as RequestInsertReplaceMode,vr as RequestKeyboardActionMode,wt as RequestLightDarkReport,Br as RequestLineFeedNewLineMode,Ur as RequestLocalEchoMode,vt as RequestNameVersion,kr as RequestSendReceiveMode,Wr as RequestUnicodeCoreMode,Fr as ResetBiDirectionalSupportMode,zr as ResetInBandResizeMode,Xr as ResetInsertReplaceMode,Gr as ResetKeyboardActionMode,Hr as ResetLineFeedNewLineMode,Qr as ResetLocalEchoMode,Vr as ResetSendReceiveMode,Yr as ResetUnicodeCoreMode,ce as SAVE_CURSOR_DEC,Xo as SCREEN_MAX_LEN_DEFAULT,Go as SCREEN_TYPICAL_LIMIT,Et as SCROLL_DOWN_1,Dt as SCROLL_UP_1,_ as SCS,$ as SEP,jr as SGRMouseMode,g as SI,Jr as SM,q as SO,ee as SOS,Zr as SRM,re as ST,$r as SendFocusEventsMode,eo as SendReceiveMode,ro as SetBiDirectionalSupportMode,oo as SetInBandResizeMode,to as SetInsertReplaceMode,so as SetKeyboardActionMode,ao as SetLineFeedNewLineMode,io as SetLocalEchoMode,no as SetSendReceiveMode,uo as SetUnicodeCoreMode,co as TextCursorEnableMode,K as UNITED_KINGDOM,N as USASCII,So as UnicodeCoreMode,Cs as XTGETTCAP,Js as XTMODKEYS,Zs as XTQMODKEYS,Bt as XTVERSION,gs as XTWINOPS,a as alternativeScreenOff,i as alternativeScreenOn,e as beep,Yo as bracketedPasteEnd,jo as bracketedPasteStart,F as clearClipboard,v as clearLineAndHomeCursor,B as clearScreenAndHomeCursor,U as clearScreenFromTopLeft,dt as clearTabStop,po as createAnsiMode,Ut as createAnsiStatusReport,lo as createDecMode,kt as createDecStatusReport,Se as cursorBackward,pe as cursorBackwardTab,le as cursorDown,Re as cursorForward,Me as cursorHide,Ce as cursorHorizontalAbsolute,me as cursorHorizontalForwardTab,Ee as cursorLeft,De as cursorMove,fe as cursorNextLine,Te as cursorPosition,Wt as cursorPositionReport,ye as cursorPreviousLine,Pe as cursorRestore,xe as cursorSave,Le as cursorShow,Ae as cursorTo,be as cursorToColumn1,Oe as cursorUp,Ie as cursorVerticalAbsolute,fs as decsin,Ts as decswt,qs as deiconifyWindow,ut as deleteCharacter,ct as deleteLine,Wo as desktopNotification,Ft as deviceStatusReport,Lo as disableAnyEventMouse,Ao as disableButtonEventMouse,bo as disableFocusTracking,Oo as disableNormalMouse,Io as disableSgrMouse,_o as disableX10Mouse,go as enableAnyEventMouse,qo as enableButtonEventMouse,Ko as enableFocusTracking,No as enableNormalMouse,ho as enableSgrMouse,wo as enableX10Mouse,vo as encodeMouseButtonByte,_e as eraseCharacter,we as eraseDisplay,ve as eraseDown,Be as eraseInLine,Ue as eraseLine,ke as eraseLineEnd,We as eraseLineStart,Fe as eraseLines,ze as eraseScreen,Xe as eraseScreenAndScrollback,Ge as eraseUp,zt as extendedCursorPositionReport,Qe as finalTerm,Ve as finalTermCmdExecuted,Ye as finalTermCmdFinished,je as finalTermCmdStart,Je as finalTermPrompt,rr as focusInEvent,or as focusOutEvent,sr as hyperlink,dr as iTerm2,Ks as iconifyWindow,ir as image,St as insertCharacter,pt as insertLine,Ro as isModeNotRecognized,Mo as isModePermanentlyReset,Co as isModePermanentlySet,mo as isModeReset,Eo as isModeSet,la as it2Cells,Ra as it2Percent,Ma as it2Pixels,$s as keyModifierOptions,pr as keypadApplicationMode,lr as keypadNumericMode,Mr as kittyGraphics,Ns as lowerWindow,hs as maximizeWindow,Bo as mouseSgrSequence,Uo as mouseX10Sequence,ws as moveWindow,Fo as notify,Ke as notifyWorkingDirectory,ea as popKittyKeyboard,ra as pushKittyKeyboard,oa as queryKeyModifierOptions,ta as queryKittyKeyboard,sa as queryModifyOtherKeys,vs as raiseWindow,Bs as refreshWindow,lt as repeatPreviousCharacter,Xt as reportKeyboardLanguageDEC,Do as reportMode,Gt as reportPrimaryDeviceAttributes,Ht as reportPrinterNoPaperDEC,Qt as reportPrinterNotReadyDEC,Vt as reportPrinterReadyDEC,Yt as reportSecondaryDeviceAttributes,jt as reportTerminalNotOK,Jt as reportTerminalOK,Zt as reportTertiaryDeviceAttributes,$t as reportUDKLockedDEC,es as reportUDKUnlockedDEC,Us as reportWindowPosition,ks as reportWindowState,d as requestBackgroundColor,Ws as requestCellSizePixels,z as requestClipboard,u as requestCursorColor,rs as requestCursorPositionReport,os as requestExtendedCursorPositionReport,c as requestForegroundColor,ts as requestKeyboardLanguageDEC,fo as requestMode,Rt as requestPresentationStateReport,ss as requestPrimaryDeviceAttributes,as as requestPrimaryDeviceAttributesParam0,is as requestPrinterStatusDEC,ns as requestSecondaryDeviceAttributes,ds as requestSecondaryDeviceAttributesParam0,ms as requestTermcap,us as requestTerminalStatus,Es as requestTerminfo,cs as requestTertiaryDeviceAttributes,Ss as requestTertiaryDeviceAttributesParam0,Fs as requestTextAreaSizeChars,zs as requestTextAreaSizePixels,ps as requestUDKStatusDEC,S as resetBackgroundColor,p as resetCursorColor,l as resetForegroundColor,aa as resetKeyModifierOptions,To as resetMode,ia as resetModifyOtherKeys,$o as resetProgressBar,k as resetTerminal,Xs as resizeTextAreaChars,Gs as resizeTextAreaPixels,Hs as restoreMaximizedWindow,Ho as screenPassthrough,ft as scrollDown,Tt as scrollUp,h as selectCharacterSet,R as setBackgroundColor,X as setClipboard,M as setCursorColor,ge as setCursorStyle,et as setErrorProgressBar,C as setForegroundColor,ys as setIconName,Ps as setIconNameAndWindowTitle,xs as setIconNameAndWindowTitleWithST,Ls as setIconNameWithST,rt as setIndeterminateProgressBar,na as setKeyModifierOptions,da as setKittyKeyboard,Mt as setLeftRightMargins,yo as setMode,ua as setModifyOtherKeys1,ca as setModifyOtherKeys2,Qs as setPageSizeLines,ot as setProgressBar,Ct as setTopBottomMargins,tt as setWarningProgressBar,As as setWindowTitle,bs as setWindowTitleWithST,Ne as setWorkingDirectory,Pt as sixelGraphics,Rs as strip,Qo as tmuxPassthrough,Is as urxvtExtension,Jo as wrapBracketedPaste,Vs as xtermWindowOp};
|
package/dist/keypad.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keypad Application Mode (DECKPAM).
|
|
3
|
+
*
|
|
4
|
+
* Switches the numeric keypad into "application" mode, so its keys transmit
|
|
5
|
+
* application control sequences instead of the plain numeric/cursor characters.
|
|
6
|
+
* This is equivalent to setting the DEC private mode DECNKM.
|
|
7
|
+
*
|
|
8
|
+
* Sequence: `ESC =`
|
|
9
|
+
* @see {@link https://vt100.net/docs/vt510-rm/DECKPAM.html}
|
|
10
|
+
*/
|
|
11
|
+
declare const keypadApplicationMode: string;
|
|
12
|
+
/** Alias for {@link keypadApplicationMode} (DEC Keypad Application Mode). */
|
|
13
|
+
declare const DECKPAM: string;
|
|
14
|
+
/**
|
|
15
|
+
* Keypad Numeric Mode (DECKPNM).
|
|
16
|
+
*
|
|
17
|
+
* Switches the numeric keypad back into "numeric" mode, so its keys transmit the
|
|
18
|
+
* plain numeric/cursor characters. This is equivalent to resetting the DEC
|
|
19
|
+
* private mode DECNKM.
|
|
20
|
+
*
|
|
21
|
+
* Sequence: `ESC >`
|
|
22
|
+
* @see {@link https://vt100.net/docs/vt510-rm/DECKPNM.html}
|
|
23
|
+
*/
|
|
24
|
+
declare const keypadNumericMode: string;
|
|
25
|
+
/** Alias for {@link keypadNumericMode} (DEC Keypad Numeric Mode). */
|
|
26
|
+
declare const DECKPNM: string;
|
|
27
|
+
export { DECKPAM, DECKPNM, keypadApplicationMode, keypadNumericMode };
|
package/dist/keypad.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ESC as o}from"./constants.js";const e=`${o}=`,i=e,p=`${o}>`,r=p;export{i as DECKPAM,r as DECKPNM,e as keypadApplicationMode,p as keypadNumericMode};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wraps a Kitty graphics protocol `payload` in the APC frame the protocol uses
|
|
3
|
+
* (`APC _ G options ; payload ST`).
|
|
4
|
+
*
|
|
5
|
+
* This is an emit-only helper: it frames a (typically Base64-encoded) `payload`
|
|
6
|
+
* together with the control `options`. It does **not** encode image data or
|
|
7
|
+
* split large payloads into chunks — the caller is responsible for Base64
|
|
8
|
+
* encoding and chunking (using the `m=1`/`m=0` options) when needed.
|
|
9
|
+
*
|
|
10
|
+
* Sequence: `APC _ G options ; payload ST`
|
|
11
|
+
* @param payload The (already-encoded) image/control payload. May be empty for control-only sequences.
|
|
12
|
+
* @param options The control options as `key=value` strings, joined with `,` (e.g. `"a=T"`, `"f=100"`).
|
|
13
|
+
* @returns The Kitty graphics `APC` escape sequence.
|
|
14
|
+
* @see {@link https://sw.kovidgoyal.net/kitty/graphics-protocol/}
|
|
15
|
+
*/
|
|
16
|
+
declare const kittyGraphics: (payload: string, ...options: string[]) => string;
|
|
17
|
+
export { kittyGraphics as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{APC as r,ST as $}from"./constants.js";const s=(o,...n)=>{const t=o.length>0?`;${o}`:"";return`${r}G${n.join(",")}${t}${$}`};export{s as default};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a sequence that triggers a desktop notification using the simple
|
|
3
|
+
* `OSC 9` protocol popularised by iTerm2.
|
|
4
|
+
*
|
|
5
|
+
* Sequence: `OSC 9 ; Mc BEL`
|
|
6
|
+
* @param message The notification body.
|
|
7
|
+
* @returns The `OSC 9` escape sequence.
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { notify } from "@visulima/ansi/notification";
|
|
11
|
+
*
|
|
12
|
+
* process.stdout.write(notify("Build finished"));
|
|
13
|
+
* ```
|
|
14
|
+
* @see {@link https://iterm2.com/documentation-escape-codes.html}
|
|
15
|
+
*/
|
|
16
|
+
declare const notify: (message: string) => string;
|
|
17
|
+
/**
|
|
18
|
+
* Returns a sequence for the extensible `OSC 99` desktop notification protocol.
|
|
19
|
+
*
|
|
20
|
+
* `OSC 99` supports optional metadata (colon-separated `key=value` pairs, e.g.
|
|
21
|
+
* `"i=1"`, `"d=1"`, `"p=title"`) followed by the payload body.
|
|
22
|
+
*
|
|
23
|
+
* Sequence: `OSC 99 ; metadata ; payload BEL`
|
|
24
|
+
* @param payload The notification body.
|
|
25
|
+
* @param metadata Optional metadata entries, joined with `:`.
|
|
26
|
+
* @returns The `OSC 99` escape sequence.
|
|
27
|
+
* @see {@link https://sw.kovidgoyal.net/kitty/desktop-notifications/}
|
|
28
|
+
*/
|
|
29
|
+
declare const desktopNotification: (payload: string, ...metadata: string[]) => string;
|
|
30
|
+
export { desktopNotification, notify };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{OSC as i,BEL as $,stripOscTerminators as t}from"./constants.js";const s=o=>`${i}9;${t(o)}${$}`,m=(o,...r)=>`${i}99;${r.map(n=>t(n)).join(":")};${t(o)}${$}`;export{m as desktopNotification,s as notify};
|
package/dist/paste.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marker a terminal emits immediately before pasted text when bracketed paste
|
|
3
|
+
* mode is enabled.
|
|
4
|
+
*
|
|
5
|
+
* Sequence: `CSI 200 ~`
|
|
6
|
+
* @see {@link https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Bracketed-Paste-Mode}
|
|
7
|
+
*/
|
|
8
|
+
declare const bracketedPasteStart: string;
|
|
9
|
+
/**
|
|
10
|
+
* Marker a terminal emits immediately after pasted text when bracketed paste
|
|
11
|
+
* mode is enabled.
|
|
12
|
+
*
|
|
13
|
+
* Sequence: `CSI 201 ~`
|
|
14
|
+
*/
|
|
15
|
+
declare const bracketedPasteEnd: string;
|
|
16
|
+
/**
|
|
17
|
+
* Wraps `text` in the bracketed-paste start/end markers, mirroring how a
|
|
18
|
+
* terminal delivers pasted content to an application.
|
|
19
|
+
* @param text The text to wrap.
|
|
20
|
+
* @returns `text` surrounded by {@link bracketedPasteStart} and {@link bracketedPasteEnd}.
|
|
21
|
+
*/
|
|
22
|
+
declare const wrapBracketedPaste: (text: string) => string;
|
|
23
|
+
export { bracketedPasteEnd, bracketedPasteStart, wrapBracketedPaste };
|
package/dist/paste.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CSI as t}from"./constants.js";const a=`${t}200~`,r=`${t}201~`,c=e=>`${a}${e}${r}`;export{r as bracketedPasteEnd,a as bracketedPasteStart,c as wrapBracketedPaste};
|
package/dist/sixel.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wraps a pre-encoded Sixel `payload` in the Sixel graphics device-control
|
|
3
|
+
* string (`DCS … q … ST`).
|
|
4
|
+
*
|
|
5
|
+
* This is an emit-only helper: it does **not** encode pixel data into Sixel
|
|
6
|
+
* format, it only frames already-encoded Sixel data so it can be written to a
|
|
7
|
+
* Sixel-capable terminal. Pass a negative value for `aspectRatio`/`backgroundMode`
|
|
8
|
+
* to omit that parameter and a non-positive value for `gridSize` to omit it.
|
|
9
|
+
*
|
|
10
|
+
* Sequence: `DCS aspectRatio ; backgroundMode ; gridSize q payload ST`
|
|
11
|
+
* @param aspectRatio The pixel aspect ratio macro parameter (omitted when negative).
|
|
12
|
+
* @param backgroundMode The background color / transparency mode (omitted when negative).
|
|
13
|
+
* @param gridSize The grid size (omitted when not positive).
|
|
14
|
+
* @param payload The already-encoded Sixel data.
|
|
15
|
+
* @returns The Sixel `DCS` escape sequence.
|
|
16
|
+
* @see {@link https://vt100.net/docs/vt3xx-gp/chapter14.html}
|
|
17
|
+
*/
|
|
18
|
+
declare const sixelGraphics: (aspectRatio: number, backgroundMode: number, gridSize: number, payload: string) => string;
|
|
19
|
+
export { sixelGraphics as default };
|
package/dist/sixel.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DCS as c,ST as e}from"./constants.js";const m=(t,$,r,i)=>{const n=t>=0?String(t):"",o=$>=0?String($):"",S=r>0?`;${String(r)}`:"";return`${c}${n};${o}${S}q${i}${e}`};export{m as default};
|
package/dist/title.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{OSC as
|
|
1
|
+
import{OSC as e,ST as i,BEL as n,stripOscTerminators as o}from"./constants.js";const $=t=>{if(typeof t!="string")throw new TypeError("Title must be a string");return o(t)},r=t=>`${e}0;${$(t)}${n}`,T=t=>`${e}1;${$(t)}${n}`,c=t=>`${e}2;${$(t)}${n}`,d=t=>`${e}21;${$(t)}${i}`,m=t=>`${e}2L;${$(t)}${i}`,w=t=>`${e}0;${$(t)}${i}`,W=t=>`${e}1;${$(t)}${i}`,a=t=>`${e}2;${$(t)}${i}`;export{m as decsin,d as decswt,T as setIconName,r as setIconNameAndWindowTitle,w as setIconNameAndWindowTitleWithST,W as setIconNameWithST,c as setWindowTitle,a as setWindowTitleWithST};
|
package/dist/urxvt.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a urxvt (rxvt-unicode) extension sequence (`OSC 777`).
|
|
3
|
+
*
|
|
4
|
+
* urxvt exposes Perl extensions through `OSC 777`, where the first parameter is
|
|
5
|
+
* the extension name followed by its arguments, e.g.
|
|
6
|
+
* `urxvtExtension("notify", "title", "body")`.
|
|
7
|
+
*
|
|
8
|
+
* Sequence: `OSC 777 ; extension ; param1 ; param2 ; … BEL`
|
|
9
|
+
* @param extension The extension name to invoke.
|
|
10
|
+
* @param parameters The extension parameters, joined with `;`.
|
|
11
|
+
* @returns The `OSC 777` escape sequence.
|
|
12
|
+
* @see {@link https://man.archlinux.org/man/urxvt.7}
|
|
13
|
+
*/
|
|
14
|
+
declare const urxvtExtension: (extension: string, ...parameters: string[]) => string;
|
|
15
|
+
export { urxvtExtension as default };
|
package/dist/urxvt.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{OSC as a,BEL as e,stripOscTerminators as o}from"./constants.js";const m=(r,...t)=>`${a}777;${o(r)};${t.map(s=>o(s)).join(";")}${e}`;export{m as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/ansi",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.18",
|
|
4
4
|
"description": "ANSI escape codes for some terminal swag.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"alternative-screen",
|
|
@@ -72,6 +72,14 @@
|
|
|
72
72
|
"types": "./dist/alternative-screen.d.ts",
|
|
73
73
|
"default": "./dist/alternative-screen.js"
|
|
74
74
|
},
|
|
75
|
+
"./background": {
|
|
76
|
+
"types": "./dist/background.d.ts",
|
|
77
|
+
"default": "./dist/background.js"
|
|
78
|
+
},
|
|
79
|
+
"./charset": {
|
|
80
|
+
"types": "./dist/charset.d.ts",
|
|
81
|
+
"default": "./dist/charset.js"
|
|
82
|
+
},
|
|
75
83
|
"./clear": {
|
|
76
84
|
"types": "./dist/clear.d.ts",
|
|
77
85
|
"default": "./dist/clear.js"
|
|
@@ -88,10 +96,22 @@
|
|
|
88
96
|
"types": "./dist/cursor.d.ts",
|
|
89
97
|
"default": "./dist/cursor.js"
|
|
90
98
|
},
|
|
99
|
+
"./cwd": {
|
|
100
|
+
"types": "./dist/cwd.d.ts",
|
|
101
|
+
"default": "./dist/cwd.js"
|
|
102
|
+
},
|
|
91
103
|
"./erase": {
|
|
92
104
|
"types": "./dist/erase.d.ts",
|
|
93
105
|
"default": "./dist/erase.js"
|
|
94
106
|
},
|
|
107
|
+
"./finalterm": {
|
|
108
|
+
"types": "./dist/finalterm.d.ts",
|
|
109
|
+
"default": "./dist/finalterm.js"
|
|
110
|
+
},
|
|
111
|
+
"./focus": {
|
|
112
|
+
"types": "./dist/focus.d.ts",
|
|
113
|
+
"default": "./dist/focus.js"
|
|
114
|
+
},
|
|
95
115
|
"./image": {
|
|
96
116
|
"types": "./dist/image.d.ts",
|
|
97
117
|
"default": "./dist/image.js"
|
|
@@ -104,6 +124,10 @@
|
|
|
104
124
|
"types": "./dist/scroll.d.ts",
|
|
105
125
|
"default": "./dist/scroll.js"
|
|
106
126
|
},
|
|
127
|
+
"./sixel": {
|
|
128
|
+
"types": "./dist/sixel.d.ts",
|
|
129
|
+
"default": "./dist/sixel.js"
|
|
130
|
+
},
|
|
107
131
|
"./strip": {
|
|
108
132
|
"types": "./dist/strip.d.ts",
|
|
109
133
|
"default": "./dist/strip.js"
|
|
@@ -116,6 +140,10 @@
|
|
|
116
140
|
"types": "./dist/title.d.ts",
|
|
117
141
|
"default": "./dist/title.js"
|
|
118
142
|
},
|
|
143
|
+
"./urxvt": {
|
|
144
|
+
"types": "./dist/urxvt.d.ts",
|
|
145
|
+
"default": "./dist/urxvt.js"
|
|
146
|
+
},
|
|
119
147
|
"./window-ops": {
|
|
120
148
|
"types": "./dist/window-ops.d.ts",
|
|
121
149
|
"default": "./dist/window-ops.js"
|
|
@@ -128,6 +156,14 @@
|
|
|
128
156
|
"types": "./dist/iterm2.d.ts",
|
|
129
157
|
"default": "./dist/iterm2.js"
|
|
130
158
|
},
|
|
159
|
+
"./keypad": {
|
|
160
|
+
"types": "./dist/keypad.d.ts",
|
|
161
|
+
"default": "./dist/keypad.js"
|
|
162
|
+
},
|
|
163
|
+
"./kitty-graphics": {
|
|
164
|
+
"types": "./dist/kitty-graphics.d.ts",
|
|
165
|
+
"default": "./dist/kitty-graphics.js"
|
|
166
|
+
},
|
|
131
167
|
"./mode": {
|
|
132
168
|
"types": "./dist/mode.d.ts",
|
|
133
169
|
"default": "./dist/mode.js"
|
|
@@ -136,10 +172,18 @@
|
|
|
136
172
|
"types": "./dist/mouse.d.ts",
|
|
137
173
|
"default": "./dist/mouse.js"
|
|
138
174
|
},
|
|
175
|
+
"./notification": {
|
|
176
|
+
"types": "./dist/notification.d.ts",
|
|
177
|
+
"default": "./dist/notification.js"
|
|
178
|
+
},
|
|
139
179
|
"./passthrough": {
|
|
140
180
|
"types": "./dist/passthrough.d.ts",
|
|
141
181
|
"default": "./dist/passthrough.js"
|
|
142
182
|
},
|
|
183
|
+
"./paste": {
|
|
184
|
+
"types": "./dist/paste.d.ts",
|
|
185
|
+
"default": "./dist/paste.js"
|
|
186
|
+
},
|
|
143
187
|
"./progress": {
|
|
144
188
|
"types": "./dist/progress.d.ts",
|
|
145
189
|
"default": "./dist/progress.js"
|