@visulima/ansi 3.0.5 → 4.0.0-alpha.1

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/dist/status.js CHANGED
@@ -1 +1,98 @@
1
- var S=Object.defineProperty;var D=(t,r)=>S(t,"name",{value:r,configurable:!0});import{S as a,C as e,D as $,a as R}from"./packem_shared/constants-D12jy2Zh.js";var m=Object.defineProperty,o=D((t,r)=>m(t,"name",{value:r,configurable:!0}),"e");class C{static{D(this,"x")}constructor(r){this.reportCode=r}static{o(this,"AnsiStatusReportImpl")}isDecReport=!1}class d{static{D(this,"m")}constructor(r){this.reportCode=r}static{o(this,"DecStatusReportImpl")}isDecReport=!0}const P=o(t=>new C(t),"createAnsiStatusReport"),p=o(t=>new d(t),"createDecStatusReport"),c=o((...t)=>{if(t.length===0)return"";let r=!1;const i=t.map(n=>(n.isDecReport&&(r=!0),n.reportCode.toString()));let s=e;return r&&(s+="?"),`${s+i.join(a)}n`},"deviceStatusReport"),L=o(t=>c(t),"DSR"),M=`${e}6n`,f=`${e}?6n`,g=o((t,r)=>{const i=Math.max(1,t),s=Math.max(1,r);return`${e+i.toString()+a+s.toString()}R`},"cursorPositionReport"),k=g,y=o((t,r,i)=>{const s=Math.max(1,t),n=Math.max(1,r);let u=`${e}?`;return u+=s.toString()+a+n.toString(),i>0&&(u+=a+i.toString()),u+="R",u},"extendedCursorPositionReport"),N=y,b=`${e}>0q`,U=b,l=`${e}c`,I=l,O=o((...t)=>t.length===0?"":`${e}?${t.join(a)}c`,"reportPrimaryDeviceAttributes"),A=`${e}>c`,_=A,j=o((t,r,i=0)=>{const s=Math.max(0,t),n=Math.max(0,r),u=Math.max(0,i);return`${e}>${s}${a}${n}${a}${u}c`},"reportSecondaryDeviceAttributes"),v=`${e}=c`,w=v,V=o(t=>`${$}!|${t}${R}`,"reportTertiaryDeviceAttributes"),X=`${e}0c`,z=`${e}>0c`,B=`${e}=0c`,E=P(5),F=c(E),G=`${e}0n`,H=`${e}3n`,h=p(15),J=c(h),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${a}${t.toString()}n`,"reportKeyboardLanguageDEC"),at=`${e}?996n`,it=o(t=>`${e}?997${a}${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,it as LightDarkReport,at as RequestLightDarkReport,b as RequestNameVersion,U as XTVERSION,P as createAnsiStatusReport,p as createDecStatusReport,g 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,l as requestPrimaryDeviceAttributes,X as requestPrimaryDeviceAttributesParam0,h as requestPrinterStatusDEC,A as requestSecondaryDeviceAttributes,z as requestSecondaryDeviceAttributesParam0,E as requestTerminalStatus,v as requestTertiaryDeviceAttributes,B as requestTertiaryDeviceAttributesParam0,q as requestUDKStatusDEC};
1
+ import { S as SEP, C as CSI, D as DCS, a as ST } from './packem_shared/constants-CE7WkXh_.js';
2
+
3
+ class AnsiStatusReportImpl {
4
+ constructor(reportCode) {
5
+ this.reportCode = reportCode;
6
+ }
7
+ isDecReport = false;
8
+ }
9
+ class DecStatusReportImpl {
10
+ constructor(reportCode) {
11
+ this.reportCode = reportCode;
12
+ }
13
+ isDecReport = true;
14
+ }
15
+ const createAnsiStatusReport = (code) => new AnsiStatusReportImpl(code);
16
+ const createDecStatusReport = (code) => new DecStatusReportImpl(code);
17
+ const deviceStatusReport = (...reports) => {
18
+ if (reports.length === 0) {
19
+ return "";
20
+ }
21
+ let hasDecReport = false;
22
+ const reportCodes = reports.map((report) => {
23
+ if (report.isDecReport) {
24
+ hasDecReport = true;
25
+ }
26
+ return report.reportCode.toString();
27
+ });
28
+ let seq = CSI;
29
+ if (hasDecReport) {
30
+ seq += "?";
31
+ }
32
+ return `${seq + reportCodes.join(SEP)}n`;
33
+ };
34
+ const DSR = (report) => deviceStatusReport(report);
35
+ const requestCursorPositionReport = `${CSI}6n`;
36
+ const requestExtendedCursorPositionReport = `${CSI}?6n`;
37
+ const cursorPositionReport = (line, column) => {
38
+ const r = Math.max(1, line);
39
+ const c = Math.max(1, column);
40
+ return `${CSI + r.toString() + SEP + c.toString()}R`;
41
+ };
42
+ const CPR = cursorPositionReport;
43
+ const extendedCursorPositionReport = (line, column, page) => {
44
+ const r = Math.max(1, line);
45
+ const c = Math.max(1, column);
46
+ let seq = `${CSI}?`;
47
+ seq += r.toString() + SEP + c.toString();
48
+ if (page > 0) {
49
+ seq += SEP + page.toString();
50
+ }
51
+ seq += "R";
52
+ return seq;
53
+ };
54
+ const DECXCPR = extendedCursorPositionReport;
55
+ const RequestNameVersion = `${CSI}>0q`;
56
+ const XTVERSION = RequestNameVersion;
57
+ const requestPrimaryDeviceAttributes = `${CSI}c`;
58
+ const DA1 = requestPrimaryDeviceAttributes;
59
+ const reportPrimaryDeviceAttributes = (...attributes) => {
60
+ if (attributes.length === 0) {
61
+ return "";
62
+ }
63
+ return `${CSI}?${attributes.join(SEP)}c`;
64
+ };
65
+ const requestSecondaryDeviceAttributes = `${CSI}>c`;
66
+ const DA2 = requestSecondaryDeviceAttributes;
67
+ const reportSecondaryDeviceAttributes = (version, level, cartridge = 0) => {
68
+ const pv = Math.max(0, version);
69
+ const pl = Math.max(0, level);
70
+ const pc = Math.max(0, cartridge);
71
+ return `${CSI}>${pv}${SEP}${pl}${SEP}${pc}c`;
72
+ };
73
+ const requestTertiaryDeviceAttributes = `${CSI}=c`;
74
+ const DA3 = requestTertiaryDeviceAttributes;
75
+ const reportTertiaryDeviceAttributes = (unitID) => `${DCS}!|${unitID}${ST}`;
76
+ const requestPrimaryDeviceAttributesParam0 = `${CSI}0c`;
77
+ const requestSecondaryDeviceAttributesParam0 = `${CSI}>0c`;
78
+ const requestTertiaryDeviceAttributesParam0 = `${CSI}=0c`;
79
+ const requestTerminalStatus = createAnsiStatusReport(5);
80
+ const DSR_TerminalStatus = deviceStatusReport(requestTerminalStatus);
81
+ const reportTerminalOK = `${CSI}0n`;
82
+ const reportTerminalNotOK = `${CSI}3n`;
83
+ const requestPrinterStatusDEC = createDecStatusReport(15);
84
+ const DSR_PrinterStatusDEC = deviceStatusReport(requestPrinterStatusDEC);
85
+ const reportPrinterReadyDEC = `${CSI}?10n`;
86
+ const reportPrinterNotReadyDEC = `${CSI}?11n`;
87
+ const reportPrinterNoPaperDEC = `${CSI}?13n`;
88
+ const requestUDKStatusDEC = createDecStatusReport(25);
89
+ const DSR_UDKStatusDEC = deviceStatusReport(requestUDKStatusDEC);
90
+ const reportUDKLockedDEC = `${CSI}?20n`;
91
+ const reportUDKUnlockedDEC = `${CSI}?21n`;
92
+ const requestKeyboardLanguageDEC = createDecStatusReport(26);
93
+ const DSR_KeyboardLanguageDEC = deviceStatusReport(requestKeyboardLanguageDEC);
94
+ const reportKeyboardLanguageDEC = (langCode) => `${CSI}?27${SEP}${langCode.toString()}n`;
95
+ const RequestLightDarkReport = `${CSI}?996n`;
96
+ const LightDarkReport = (dark) => `${CSI}?997${SEP}${dark ? "1" : "2"}n`;
97
+
98
+ export { CPR, DA1, DA2, DA3, DECXCPR, DSR, DSR_KeyboardLanguageDEC, DSR_PrinterStatusDEC, DSR_TerminalStatus, DSR_UDKStatusDEC, LightDarkReport, RequestLightDarkReport, RequestNameVersion, 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 };
package/dist/strip.js CHANGED
@@ -1 +1,12 @@
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,s=u((e,r)=>o(e,"name",{value:r,configurable:!0}),"r");const i=a(),f=s(e=>e.replace(/\u001B\]0;.*\u0007/,"").replace(i,""),"strip");export{f as default};
1
+ function ansiRegex({ onlyFirst = false } = {}) {
2
+ const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
3
+ const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
4
+ const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
5
+ const pattern = `${osc}|${csi}`;
6
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
7
+ }
8
+
9
+ const regex = ansiRegex();
10
+ const strip = (input) => input.replace(/\u001B\]0;.*\u0007/, "").replace(regex, "");
11
+
12
+ export { strip as default };
package/dist/termcap.js CHANGED
@@ -1 +1,25 @@
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 { D as DCS, a as ST, S as SEP } from './packem_shared/constants-CE7WkXh_.js';
2
+
3
+ const stringToHex = (input) => {
4
+ let hex = "";
5
+ for (let index = 0; index < input.length; index += 1) {
6
+ const charCode = input.codePointAt(index);
7
+ if (charCode === void 0) {
8
+ continue;
9
+ }
10
+ const byteHex = charCode.toString(16).toUpperCase();
11
+ hex += byteHex.length === 1 ? `0${byteHex}` : byteHex;
12
+ }
13
+ return hex;
14
+ };
15
+ const XTGETTCAP = (...caps) => {
16
+ if (caps.length === 0) {
17
+ return "";
18
+ }
19
+ const hexCaps = caps.map((cap) => stringToHex(cap));
20
+ return `${DCS}+q${hexCaps.join(SEP)}${ST}`;
21
+ };
22
+ const requestTermcap = XTGETTCAP;
23
+ const requestTerminfo = XTGETTCAP;
24
+
25
+ export { XTGETTCAP, requestTermcap, requestTerminfo };
package/dist/title.js CHANGED
@@ -1 +1,18 @@
1
- var d=Object.defineProperty;var a=(e,n)=>d(e,"name",{value:n,configurable:!0});import{O as i,B as o,a as s}from"./packem_shared/constants-D12jy2Zh.js";var r=Object.defineProperty,t=a((e,n)=>r(e,"name",{value:n,configurable:!0}),"n");const T=t(e=>{if(typeof e!="string")throw new TypeError("Title must be a string");return e.replaceAll(/[\u0007\u001B]/g,"")},"validateTitle"),W=t(e=>`${i}0;${T(e)}${o}`,"setIconNameAndWindowTitle"),m=t(e=>`${i}1;${e}${o}`,"setIconName"),$=t(e=>`${i}2;${e}${o}`,"setWindowTitle"),w=t(e=>$(`1;${e}`),"decswt"),I=t(e=>$(`L;${e}`),"decsin"),N=t(e=>`${i}0;${e}${s}`,"setIconNameAndWindowTitleWithST"),S=t(e=>`${i}1;${e}${s}`,"setIconNameWithST"),h=t(e=>`${i}2;${e}${s}`,"setWindowTitleWithST");export{I as decsin,w as decswt,m as setIconName,W as setIconNameAndWindowTitle,N as setIconNameAndWindowTitleWithST,S as setIconNameWithST,$ as setWindowTitle,h as setWindowTitleWithST};
1
+ import { O as OSC, B as BEL, a as ST } from './packem_shared/constants-CE7WkXh_.js';
2
+
3
+ const validateTitle = (title) => {
4
+ if (typeof title !== "string") {
5
+ throw new TypeError("Title must be a string");
6
+ }
7
+ return title.replaceAll(/[\u0007\u001B]/g, "");
8
+ };
9
+ const setIconNameAndWindowTitle = (title) => `${OSC}0;${validateTitle(title)}${BEL}`;
10
+ const setIconName = (iconName) => `${OSC}1;${iconName}${BEL}`;
11
+ const setWindowTitle = (title) => `${OSC}2;${title}${BEL}`;
12
+ const decswt = (title) => setWindowTitle(`1;${title}`);
13
+ const decsin = (name) => setWindowTitle(`L;${name}`);
14
+ const setIconNameAndWindowTitleWithST = (title) => `${OSC}0;${title}${ST}`;
15
+ const setIconNameWithST = (iconName) => `${OSC}1;${iconName}${ST}`;
16
+ const setWindowTitleWithST = (title) => `${OSC}2;${title}${ST}`;
17
+
18
+ export { decsin, decswt, setIconName, setIconNameAndWindowTitle, setIconNameAndWindowTitleWithST, setIconNameWithST, setWindowTitle, setWindowTitleWithST };
@@ -1 +1,61 @@
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",_[_.LOWER_WINDOW=6]="LOWER_WINDOW",_[_.MAXIMIZE_WINDOW=10]="MAXIMIZE_WINDOW",_[_.MAXIMIZE_WINDOW_HORIZONTALLY=10.2]="MAXIMIZE_WINDOW_HORIZONTALLY",_[_.MAXIMIZE_WINDOW_VERTICALLY=10.1]="MAXIMIZE_WINDOW_VERTICALLY",_[_.MOVE_WINDOW=3]="MOVE_WINDOW",_[_.POP_WINDOW_TITLE=23]="POP_WINDOW_TITLE",_[_.PUSH_WINDOW_TITLE=22]="PUSH_WINDOW_TITLE",_[_.RAISE_WINDOW=5]="RAISE_WINDOW",_[_.REFRESH_WINDOW=7]="REFRESH_WINDOW",_[_.REPORT_CELL_SIZE_PIXELS=16]="REPORT_CELL_SIZE_PIXELS",_[_.REPORT_ICON_LABEL=19]="REPORT_ICON_LABEL",_[_.REPORT_TEXT_AREA_SIZE_CHARS=14]="REPORT_TEXT_AREA_SIZE_CHARS",_[_.REPORT_TEXT_AREA_SIZE_PIXELS=18]="REPORT_TEXT_AREA_SIZE_PIXELS",_[_.REPORT_WINDOW_POSITION=13]="REPORT_WINDOW_POSITION",_[_.REPORT_WINDOW_STATE=11]="REPORT_WINDOW_STATE",_[_.REPORT_WINDOW_TITLE=21]="REPORT_WINDOW_TITLE",_[_.REQUEST_WINDOW_SIZE_WIN_OP_COMPAT=14]="REQUEST_WINDOW_SIZE_WIN_OP_COMPAT",_[_.RESIZE_SCREEN_AND_TEXT_AREA=24]="RESIZE_SCREEN_AND_TEXT_AREA",_[_.RESIZE_TEXT_AREA_CHARS=4]="RESIZE_TEXT_AREA_CHARS",_[_.RESIZE_TEXT_AREA_PIXELS=8]="RESIZE_TEXT_AREA_PIXELS",_[_.RESTORE_MAXIMIZED_WINDOW=9]="RESTORE_MAXIMIZED_WINDOW",_[_.UNDO_FULL_SCREEN_MODE=10.3]="UNDO_FULL_SCREEN_MODE",_))(A||{});const I=e((_,...W)=>{if(![10.1,10.2,10.3].includes(_)&&_<=0)return"";const O=[_];for(const i of W)i>=0&&O.push(i);return`${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 { C as CSI } from './packem_shared/constants-CE7WkXh_.js';
2
+
3
+ var XTermWindowOp = /* @__PURE__ */ ((XTermWindowOp2) => {
4
+ XTermWindowOp2[XTermWindowOp2["DEICONIFY_WINDOW"] = 1] = "DEICONIFY_WINDOW";
5
+ XTermWindowOp2[XTermWindowOp2["ICONIFY_WINDOW"] = 2] = "ICONIFY_WINDOW";
6
+ XTermWindowOp2[XTermWindowOp2["LOWER_WINDOW"] = 6] = "LOWER_WINDOW";
7
+ XTermWindowOp2[XTermWindowOp2["MAXIMIZE_WINDOW"] = 10] = "MAXIMIZE_WINDOW";
8
+ XTermWindowOp2[XTermWindowOp2["MAXIMIZE_WINDOW_HORIZONTALLY"] = 10.2] = "MAXIMIZE_WINDOW_HORIZONTALLY";
9
+ XTermWindowOp2[XTermWindowOp2["MAXIMIZE_WINDOW_VERTICALLY"] = 10.1] = "MAXIMIZE_WINDOW_VERTICALLY";
10
+ XTermWindowOp2[XTermWindowOp2["MOVE_WINDOW"] = 3] = "MOVE_WINDOW";
11
+ XTermWindowOp2[XTermWindowOp2["POP_WINDOW_TITLE"] = 23] = "POP_WINDOW_TITLE";
12
+ XTermWindowOp2[XTermWindowOp2["PUSH_WINDOW_TITLE"] = 22] = "PUSH_WINDOW_TITLE";
13
+ XTermWindowOp2[XTermWindowOp2["RAISE_WINDOW"] = 5] = "RAISE_WINDOW";
14
+ XTermWindowOp2[XTermWindowOp2["REFRESH_WINDOW"] = 7] = "REFRESH_WINDOW";
15
+ XTermWindowOp2[XTermWindowOp2["REPORT_CELL_SIZE_PIXELS"] = 16] = "REPORT_CELL_SIZE_PIXELS";
16
+ XTermWindowOp2[XTermWindowOp2["REPORT_ICON_LABEL"] = 19] = "REPORT_ICON_LABEL";
17
+ XTermWindowOp2[XTermWindowOp2["REPORT_TEXT_AREA_SIZE_CHARS"] = 14] = "REPORT_TEXT_AREA_SIZE_CHARS";
18
+ XTermWindowOp2[XTermWindowOp2["REPORT_TEXT_AREA_SIZE_PIXELS"] = 18] = "REPORT_TEXT_AREA_SIZE_PIXELS";
19
+ XTermWindowOp2[XTermWindowOp2["REPORT_WINDOW_POSITION"] = 13] = "REPORT_WINDOW_POSITION";
20
+ XTermWindowOp2[XTermWindowOp2["REPORT_WINDOW_STATE"] = 11] = "REPORT_WINDOW_STATE";
21
+ XTermWindowOp2[XTermWindowOp2["REPORT_WINDOW_TITLE"] = 21] = "REPORT_WINDOW_TITLE";
22
+ XTermWindowOp2[XTermWindowOp2["REQUEST_WINDOW_SIZE_WIN_OP_COMPAT"] = 14] = "REQUEST_WINDOW_SIZE_WIN_OP_COMPAT";
23
+ XTermWindowOp2[XTermWindowOp2["RESIZE_SCREEN_AND_TEXT_AREA"] = 24] = "RESIZE_SCREEN_AND_TEXT_AREA";
24
+ XTermWindowOp2[XTermWindowOp2["RESIZE_TEXT_AREA_CHARS"] = 4] = "RESIZE_TEXT_AREA_CHARS";
25
+ XTermWindowOp2[XTermWindowOp2["RESIZE_TEXT_AREA_PIXELS"] = 8] = "RESIZE_TEXT_AREA_PIXELS";
26
+ XTermWindowOp2[XTermWindowOp2["RESTORE_MAXIMIZED_WINDOW"] = 9] = "RESTORE_MAXIMIZED_WINDOW";
27
+ XTermWindowOp2[XTermWindowOp2["UNDO_FULL_SCREEN_MODE"] = 10.3] = "UNDO_FULL_SCREEN_MODE";
28
+ return XTermWindowOp2;
29
+ })(XTermWindowOp || {});
30
+ const xtermWindowOp = (p, ...ps) => {
31
+ const allowedFloats = [10.1 /* MAXIMIZE_WINDOW_VERTICALLY */, 10.2 /* MAXIMIZE_WINDOW_HORIZONTALLY */, 10.3 /* UNDO_FULL_SCREEN_MODE */];
32
+ if (allowedFloats.includes(p)) ; else if (p <= 0) {
33
+ return "";
34
+ }
35
+ const parameters = [p];
36
+ for (const value of ps) {
37
+ if (value >= 0) {
38
+ parameters.push(value);
39
+ }
40
+ }
41
+ return `${CSI}${parameters.join(";")}t`;
42
+ };
43
+ const XTWINOPS = xtermWindowOp;
44
+ const resizeTextAreaChars = (height, width) => xtermWindowOp(4 /* RESIZE_TEXT_AREA_CHARS */, height, width);
45
+ const requestTextAreaSizeChars = () => xtermWindowOp(14 /* REQUEST_WINDOW_SIZE_WIN_OP_COMPAT */);
46
+ const requestCellSizePixels = () => xtermWindowOp(16 /* REPORT_CELL_SIZE_PIXELS */);
47
+ const requestTextAreaSizePixels = () => xtermWindowOp(18 /* REPORT_TEXT_AREA_SIZE_PIXELS */);
48
+ const deiconifyWindow = () => xtermWindowOp(1 /* DEICONIFY_WINDOW */);
49
+ const iconifyWindow = () => xtermWindowOp(2 /* ICONIFY_WINDOW */);
50
+ const moveWindow = (x, y) => xtermWindowOp(3 /* MOVE_WINDOW */, x, y);
51
+ const raiseWindow = () => xtermWindowOp(5 /* RAISE_WINDOW */);
52
+ const lowerWindow = () => xtermWindowOp(6 /* LOWER_WINDOW */);
53
+ const refreshWindow = () => xtermWindowOp(7 /* REFRESH_WINDOW */);
54
+ const resizeTextAreaPixels = (height, width) => xtermWindowOp(8 /* RESIZE_TEXT_AREA_PIXELS */, height, width);
55
+ const restoreMaximizedWindow = () => xtermWindowOp(9 /* RESTORE_MAXIMIZED_WINDOW */);
56
+ const maximizeWindow = () => xtermWindowOp(10 /* MAXIMIZE_WINDOW */);
57
+ const reportWindowPosition = () => xtermWindowOp(13 /* REPORT_WINDOW_POSITION */);
58
+ const reportWindowState = () => xtermWindowOp(11 /* REPORT_WINDOW_STATE */);
59
+ const setPageSizeLines = (lines) => xtermWindowOp(24 /* RESIZE_SCREEN_AND_TEXT_AREA */, lines);
60
+
61
+ export { XTWINOPS, XTermWindowOp, deiconifyWindow, iconifyWindow, lowerWindow, maximizeWindow, moveWindow, raiseWindow, refreshWindow, reportWindowPosition, reportWindowState, requestCellSizePixels, requestTextAreaSizeChars, requestTextAreaSizePixels, resizeTextAreaChars, resizeTextAreaPixels, restoreMaximizedWindow, setPageSizeLines, xtermWindowOp };
package/dist/xterm.js CHANGED
@@ -1 +1,33 @@
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 { C as CSI } from './packem_shared/constants-CE7WkXh_.js';
2
+
3
+ const keyModifierOptions = (resource, value) => {
4
+ if (resource < 0 || !Number.isInteger(resource)) {
5
+ return "";
6
+ }
7
+ const pp = resource.toString();
8
+ if (value !== void 0) {
9
+ if (!Number.isInteger(value)) {
10
+ return "";
11
+ }
12
+ const pv = value.toString();
13
+ return `${CSI}>${pp};${pv}m`;
14
+ }
15
+ return `${CSI}>${pp}m`;
16
+ };
17
+ const XTMODKEYS = keyModifierOptions;
18
+ const queryKeyModifierOptions = (resource) => {
19
+ if (resource < 0 || !Number.isInteger(resource)) {
20
+ return "";
21
+ }
22
+ const pp = resource.toString();
23
+ return `${CSI}?${pp}m`;
24
+ };
25
+ const resetKeyModifierOptions = (resource) => keyModifierOptions(resource);
26
+ const setKeyModifierOptions = (resource, value) => keyModifierOptions(resource, value);
27
+ const XTQMODKEYS = queryKeyModifierOptions;
28
+ const setModifyOtherKeys1 = `${CSI}>4;1m`;
29
+ const setModifyOtherKeys2 = `${CSI}>4;2m`;
30
+ const resetModifyOtherKeys = `${CSI}>4m`;
31
+ const queryModifyOtherKeys = `${CSI}?4m`;
32
+
33
+ export { XTMODKEYS, XTQMODKEYS, keyModifierOptions, queryKeyModifierOptions, queryModifyOtherKeys, resetKeyModifierOptions, resetModifyOtherKeys, setKeyModifierOptions, setModifyOtherKeys1, setModifyOtherKeys2 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/ansi",
3
- "version": "3.0.5",
3
+ "version": "4.0.0-alpha.1",
4
4
  "description": "ANSI escape codes for some terminal swag.",
5
5
  "keywords": [
6
6
  "alternative-screen",
@@ -46,7 +46,7 @@
46
46
  "repository": {
47
47
  "type": "git",
48
48
  "url": "git+https://github.com/visulima/visulima.git",
49
- "directory": "packages/ansi"
49
+ "directory": "packages/terminal/ansi"
50
50
  },
51
51
  "funding": [
52
52
  {
@@ -153,11 +153,57 @@
153
153
  "README.md",
154
154
  "CHANGELOG.md"
155
155
  ],
156
+ "devDependencies": {
157
+ "@anolilab/eslint-config": "16.4.4",
158
+ "@anolilab/prettier-config": "^6.0.8",
159
+ "@anolilab/semantic-release-pnpm": "3.2.0",
160
+ "@anolilab/semantic-release-preset": "^12.1.0",
161
+ "@arethetypeswrong/cli": "^0.18.2",
162
+ "@secretlint/secretlint-rule-preset-recommend": "^11.2.5",
163
+ "@total-typescript/ts-reset": "^0.6.1",
164
+ "@types/node": "24.10.1",
165
+ "@visulima/colorize": "2.0.0-alpha.1",
166
+ "@visulima/packem": "2.0.0-alpha.37",
167
+ "@visulima/path": "3.0.0-alpha.1",
168
+ "@vitest/coverage-v8": "^4.0.15",
169
+ "@vitest/ui": "^4.0.15",
170
+ "ansi-regex": "^6.2.2",
171
+ "conventional-changelog-conventionalcommits": "9.1.0",
172
+ "esbuild": "0.27.1",
173
+ "eslint": "9.39.1",
174
+ "jiti": "^2.6.1",
175
+ "prettier": "^3.7.4",
176
+ "publint": "^0.3.15",
177
+ "restore-cursor": "^5.1.0",
178
+ "rimraf": "6.1.2",
179
+ "secretlint": "11.2.5",
180
+ "semantic-release": "^25.0.2",
181
+ "type-fest": "^5.3.0",
182
+ "typescript": "5.9.3",
183
+ "vitest": "^4.0.15"
184
+ },
156
185
  "engines": {
157
- "node": ">=20.19 <=25.x"
186
+ "node": ">=22.13 <=25.x"
158
187
  },
159
188
  "publishConfig": {
160
189
  "access": "public",
161
190
  "provenance": true
191
+ },
192
+ "scripts": {
193
+ "build": "packem build --development",
194
+ "build:prod": "packem build --production",
195
+ "clean": "rimraf node_modules dist .eslintcache",
196
+ "dev": "pnpm run build --watch",
197
+ "lint:attw": "attw --pack",
198
+ "lint:eslint": "eslint . --cache --concurrency auto",
199
+ "lint:eslint:fix": "eslint . --cache --concurrency auto --fix",
200
+ "lint:package-json": "publint --strict",
201
+ "lint:prettier": "prettier --config=.prettierrc.cjs --check .",
202
+ "lint:prettier:fix": "prettier --config=.prettierrc.cjs --write .",
203
+ "lint:types": "tsc --noEmit",
204
+ "test": "vitest run",
205
+ "test:coverage": "vitest run --coverage",
206
+ "test:ui": "vitest --ui --coverage.enabled=true",
207
+ "test:watch": "vitest"
162
208
  }
163
209
  }
@@ -1 +0,0 @@
1
- var l=Object.defineProperty;var r=(e,t)=>l(e,"name",{value:t,configurable:!0});var n=Object.defineProperty,i=r((e,t)=>n(e,"name",{value:t,configurable:!0}),"e");const o="auto",c=i(e=>e.toString(),"it2Cells"),s=i(e=>`${e}px`,"it2Pixels"),P=i(e=>`${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 r=(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=r(t=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,i]=s.versions.node.split(".").map(Number);if(e>22||e===22&&i>=3||e===20&&i>=16)return s.getBuiltinModule(t)}return h(t)},"__cjs_getBuiltinModule"),{Buffer:c}=u("node:buffer");var p=Object.defineProperty,o=r((t,e)=>p(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=${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 m{static{r(this,"ITerm2File")}static{o(this,"ITerm2File")}fileProps;constructor(e,i){if(this.fileProps={...e},i){if(i.byteLength>10*1024*1024)throw new Error("File size exceeds maximum limit of 10MB");if(this.fileProps.content=c.from(i).toString("base64"),this.fileProps.size===void 0&&(this.fileProps.size=i.byteLength),this.fileProps.size!==i.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{r(this,"ITerm2FileEnd")}static{o(this,"ITerm2FileEnd")}toString(){return"FileEnd"}}class F{static{r(this,"ITerm2FilePart")}constructor(e){this.base64Chunk=e}static{o(this,"ITerm2FilePart")}toString(){return`FilePart=${this.base64Chunk}`}}class P{static{r(this,"ITerm2MultipartFileStart")}constructor(e){this.properties=e}static{o(this,"ITerm2MultipartFileStart")}toString(){return`MultipartFile=${n(this.properties)}`}}export{m as ITerm2File,g as ITerm2FileEnd,F as ITerm2FilePart,P 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 l=Object.defineProperty;var n=(r,o)=>l(r,"name",{value:o,configurable:!0});import{C as s,S as u,E as c}from"./constants-D12jy2Zh.js";import"./restoreCursor-CHy0jZuu.js";const i=globalThis?.window?.document!==void 0,t=!i&&process.env.TERM_PROGRAM==="Apple_Terminal",T=!i&&(process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE));var $=Object.defineProperty,a=n((r,o)=>$(r,"name",{value:o,configurable:!0}),"n");const S=`${c}7`,d=`${c}8`,w=`${s}A`,U=`${s}B`,k=`${s}C`,p=`${s}D`,v=`${s}6n`,A=`${s}?6n`,R=a((r=1)=>`${s+r}D`,"cursorBackward"),D=a((r=1)=>`${s+r}B`,"cursorDown"),y=a((r=1)=>`${s+r}C`,"cursorForward"),b=`${s}?25l`,g=`${s}G`,m=a((r=1)=>R(r),"cursorLeft"),C=a((r=1)=>`${s+r}G`,"cursorHorizontalAbsolute"),P=a((r,o)=>{let e="";return r<0?e+=`${s+-r}D`:r>0&&(e+=`${s+r}C`),o<0?e+=`${s+-o}A`:o>0&&(e+=`${s+o}B`),e},"cursorMove"),f=a((r=1)=>`${s+r}E`,"cursorNextLine"),H=a((r=1)=>`${s+r}F`,"cursorPreviousLine"),h=t?d:`${c}u`,F=t?S:`${c}s`,I=`${s}?25h`,L=a((r,o)=>o===void 0?C(r+1):`${s+(o+1)+u+(r+1)}H`,"cursorTo"),N=a((r,o)=>o===void 0?`${s+r}H`:`${s+r+u+o}H`,"cursorPosition"),z=a((r=1)=>`${s+r}I`,"cursorHorizontalForwardTab"),x=a((r=1)=>`${s+r}Z`,"cursorBackwardTab"),M=a((r=1)=>`${s+r}X`,"eraseCharacter"),W=a((r=1)=>`${s+r}d`,"cursorVerticalAbsolute"),G=a((r=1)=>`${s+r}A`,"cursorUp");var B=(r=>(r[r.BlinkingBar=5]="BlinkingBar",r[r.BlinkingBlock=1]="BlinkingBlock",r[r.BlinkingUnderline=3]="BlinkingUnderline",r[r.Default=0]="Default",r[r.SteadyBar=6]="SteadyBar",r[r.SteadyBlock=2]="SteadyBlock",r[r.SteadyUnderline=4]="SteadyUnderline",r))(B||{});const V=a(r=>`${s+r} q`,"setCursorStyle");export{T as A,B,p as C,v as R,S,U as a,k as b,w as c,R as d,x as e,D as f,y as g,b as h,C as i,z as j,m as k,P as l,f as m,N as n,H as o,h as p,F as q,I as r,L as s,g as t,G as u,W as v,M as w,A as x,d as y,V as z};
@@ -1 +0,0 @@
1
- var o=Object.defineProperty;var n=(r,e)=>o(r,"name",{value:e,configurable:!0});import{O as t,B as s}from"./constants-D12jy2Zh.js";var $=Object.defineProperty,a=n((r,e)=>$(r,"name",{value:e,configurable:!0}),"n");const B=`${t}9;4;0${s}`,i=a(r=>{const e=Math.min(Math.max(0,r),100);return`${t}9;4;1;${e}${s}`},"setProgressBar"),P=a(r=>{const e=Math.min(Math.max(0,r),100);return`${t}9;4;2;${e}${s}`},"setErrorProgressBar"),c=`${t}9;4;3${s}`,h=a(r=>{const e=Math.min(Math.max(0,r),100);return`${t}9;4;4;${e}${s}`},"setWarningProgressBar");export{B as resetProgressBar,P as setErrorProgressBar,c as setIndeterminateProgressBar,i 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};