@prozilla-os/terminal 1.0.9 → 1.1.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/LICENSE +674 -0
- package/dist/{cat-Dp7MxLJO.js → cat-FW5-WCC9.js} +2 -2
- package/dist/{cat-Dp7MxLJO.js.map → cat-FW5-WCC9.js.map} +1 -1
- package/dist/{cd-zk1UnOo7.js → cd-CJ_-Ao6a.js} +2 -2
- package/dist/{cd-zk1UnOo7.js.map → cd-CJ_-Ao6a.js.map} +1 -1
- package/dist/{cmatrix-O49Zkqb8.js → cmatrix-Dp2xw_1D.js} +2 -2
- package/dist/{cmatrix-O49Zkqb8.js.map → cmatrix-Dp2xw_1D.js.map} +1 -1
- package/dist/{compgen-CA_GMRpy.js → compgen-yV_rUCTl.js} +2 -2
- package/dist/{compgen-CA_GMRpy.js.map → compgen-yV_rUCTl.js.map} +1 -1
- package/dist/{cowsay-BAYsU72K.js → cowsay-DhGebg2w.js} +2 -2
- package/dist/{cowsay-BAYsU72K.js.map → cowsay-DhGebg2w.js.map} +1 -1
- package/dist/eval-CnKC-mrj.js +14 -0
- package/dist/eval-CnKC-mrj.js.map +1 -0
- package/dist/{help-CYIno6WY.js → help-K3OSEH-4.js} +2 -2
- package/dist/{help-CYIno6WY.js.map → help-K3OSEH-4.js.map} +1 -1
- package/dist/{lolcat-LdzLGQur.js → lolcat-e6AdhtPY.js} +2 -2
- package/dist/{lolcat-LdzLGQur.js.map → lolcat-e6AdhtPY.js.map} +1 -1
- package/dist/{ls-Csd6ypmW.js → ls-Cv8zACh_.js} +2 -2
- package/dist/{ls-Csd6ypmW.js.map → ls-Cv8zACh_.js.map} +1 -1
- package/dist/{main-tAp_mbfZ.js → main-BY8DgnTe.js} +91 -90
- package/dist/{main-tAp_mbfZ.js.map → main-BY8DgnTe.js.map} +1 -1
- package/dist/main.js +1 -1
- package/dist/{make-DOc--PtL.js → make-Cr6zPi10.js} +2 -2
- package/dist/{make-DOc--PtL.js.map → make-Cr6zPi10.js.map} +1 -1
- package/dist/{man-CZoHwxyo.js → man-B0gSJec-.js} +2 -2
- package/dist/{man-CZoHwxyo.js.map → man-B0gSJec-.js.map} +1 -1
- package/dist/{neofetch-KcdwHJSJ.js → neofetch-Cq2qUtOn.js} +2 -2
- package/dist/{neofetch-KcdwHJSJ.js.map → neofetch-Cq2qUtOn.js.map} +1 -1
- package/dist/{reload-zi8L0xNG.js → reload-BMeeiK59.js} +2 -2
- package/dist/{reload-zi8L0xNG.js.map → reload-BMeeiK59.js.map} +1 -1
- package/dist/{rm-KQ9gM6fT.js → rm-DrsNwyIE.js} +2 -2
- package/dist/{rm-KQ9gM6fT.js.map → rm-DrsNwyIE.js.map} +1 -1
- package/dist/{rmdir-UqUqHZTI.js → rmdir-BZAP4H6B.js} +2 -2
- package/dist/{rmdir-UqUqHZTI.js.map → rmdir-BZAP4H6B.js.map} +1 -1
- package/dist/{sl-BOyfa7Iu.js → sl-iFJMGBu9.js} +2 -2
- package/dist/{sl-BOyfa7Iu.js.map → sl-iFJMGBu9.js.map} +1 -1
- package/dist/{touch-D_kKTiUQ.js → touch-4AvKZiqp.js} +2 -2
- package/dist/{touch-D_kKTiUQ.js.map → touch-4AvKZiqp.js.map} +1 -1
- package/dist/{whatis-CYD52uq2.js → whatis-iNlzdd4F.js} +2 -2
- package/dist/{whatis-CYD52uq2.js.map → whatis-iNlzdd4F.js.map} +1 -1
- package/package.json +4 -4
- package/LICENSE.md +0 -21
- package/dist/src/components/Ansi.d.ts +0 -9
- package/dist/src/components/InputLine.d.ts +0 -11
- package/dist/src/components/OutputLine.d.ts +0 -6
- package/dist/src/components/Terminal.d.ts +0 -6
- package/dist/src/constants/terminal.const.d.ts +0 -7
- package/dist/src/core/_utils/terminal.utils.d.ts +0 -2
- package/dist/src/core/command.d.ts +0 -50
- package/dist/src/core/commands/cat.d.ts +0 -2
- package/dist/src/core/commands/cd.d.ts +0 -2
- package/dist/src/core/commands/clear.d.ts +0 -2
- package/dist/src/core/commands/cmatrix.d.ts +0 -2
- package/dist/src/core/commands/compgen.d.ts +0 -2
- package/dist/src/core/commands/cowsay.d.ts +0 -2
- package/dist/src/core/commands/dir.d.ts +0 -2
- package/dist/src/core/commands/echo.d.ts +0 -2
- package/dist/src/core/commands/exit.d.ts +0 -2
- package/dist/src/core/commands/fortune.d.ts +0 -2
- package/dist/src/core/commands/help.d.ts +0 -2
- package/dist/src/core/commands/hostname.d.ts +0 -2
- package/dist/src/core/commands/lolcat.d.ts +0 -2
- package/dist/src/core/commands/ls.d.ts +0 -2
- package/dist/src/core/commands/make.d.ts +0 -2
- package/dist/src/core/commands/man.d.ts +0 -2
- package/dist/src/core/commands/mkdir.d.ts +0 -2
- package/dist/src/core/commands/neofetch.d.ts +0 -2
- package/dist/src/core/commands/pwd.d.ts +0 -2
- package/dist/src/core/commands/reboot.d.ts +0 -2
- package/dist/src/core/commands/reload.d.ts +0 -2
- package/dist/src/core/commands/rev.d.ts +0 -2
- package/dist/src/core/commands/rm.d.ts +0 -2
- package/dist/src/core/commands/rmdir.d.ts +0 -2
- package/dist/src/core/commands/sl.d.ts +0 -2
- package/dist/src/core/commands/touch.d.ts +0 -2
- package/dist/src/core/commands/uptime.d.ts +0 -2
- package/dist/src/core/commands/whatis.d.ts +0 -2
- package/dist/src/core/commands/whoami.d.ts +0 -2
- package/dist/src/core/commands.d.ts +0 -7
- package/dist/src/core/stream.d.ts +0 -18
- package/dist/src/main.d.ts +0 -4
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/vite.config.d.ts +0 -2
|
@@ -275,13 +275,13 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
275
275
|
value: function(n, s, f) {
|
|
276
276
|
var y = this, i = this, u = n.split(/\033\[/), c = u.shift();
|
|
277
277
|
s == null && (s = {}), s.clearLine = /\r/.test(n);
|
|
278
|
-
var o = u.map(function(
|
|
279
|
-
return y.processChunk(
|
|
278
|
+
var o = u.map(function(_) {
|
|
279
|
+
return y.processChunk(_, s, f);
|
|
280
280
|
});
|
|
281
281
|
if (s && s.json) {
|
|
282
282
|
var r = i.processChunkJson("");
|
|
283
|
-
return r.content = c, r.clearLine = s.clearLine, o.unshift(r), s.remove_empty && (o = o.filter(function(
|
|
284
|
-
return !
|
|
283
|
+
return r.content = c, r.clearLine = s.clearLine, o.unshift(r), s.remove_empty && (o = o.filter(function(_) {
|
|
284
|
+
return !_.isEmpty();
|
|
285
285
|
})), o;
|
|
286
286
|
} else
|
|
287
287
|
o.unshift(c);
|
|
@@ -337,7 +337,7 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
337
337
|
if (c[1] !== "" || c[3] !== "m" || !f)
|
|
338
338
|
return u;
|
|
339
339
|
for (var r = this; o.length > 0; ) {
|
|
340
|
-
var
|
|
340
|
+
var _ = o.shift(), a = parseInt(_);
|
|
341
341
|
if (isNaN(a) || a === 0)
|
|
342
342
|
r.fg = r.bg = null, r.decorations = [];
|
|
343
343
|
else if (a === 1)
|
|
@@ -389,18 +389,18 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
389
389
|
if (o.length >= 1) {
|
|
390
390
|
var k = o.shift();
|
|
391
391
|
if (k === "5" && o.length >= 1) {
|
|
392
|
-
var
|
|
393
|
-
if (
|
|
392
|
+
var h = parseInt(o.shift());
|
|
393
|
+
if (h >= 0 && h <= 255)
|
|
394
394
|
if (!y)
|
|
395
|
-
this.PALETTE_COLORS || r.setupPalette(), v ? r.fg = this.PALETTE_COLORS[
|
|
395
|
+
this.PALETTE_COLORS || r.setupPalette(), v ? r.fg = this.PALETTE_COLORS[h] : r.bg = this.PALETTE_COLORS[h];
|
|
396
396
|
else {
|
|
397
|
-
var
|
|
398
|
-
v ? r.fg =
|
|
397
|
+
var $ = h >= 16 ? "ansi-palette-" + h : A[h > 7 ? 1 : 0][h % 8].class;
|
|
398
|
+
v ? r.fg = $ : r.bg = $;
|
|
399
399
|
}
|
|
400
400
|
} else if (k === "2" && o.length >= 3) {
|
|
401
|
-
var
|
|
402
|
-
if (
|
|
403
|
-
var T =
|
|
401
|
+
var O = parseInt(o.shift()), M = parseInt(o.shift()), D = parseInt(o.shift());
|
|
402
|
+
if (O >= 0 && O <= 255 && M >= 0 && M <= 255 && D >= 0 && D <= 255) {
|
|
403
|
+
var T = O + ", " + M + ", " + D;
|
|
404
404
|
y ? v ? (r.fg = "ansi-truecolor", r.fg_truecolor = T) : (r.bg = "ansi-truecolor", r.bg_truecolor = T) : v ? r.fg = T : r.bg = T;
|
|
405
405
|
}
|
|
406
406
|
}
|
|
@@ -435,8 +435,8 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
435
435
|
i.fg || (i.fg = A[0][7][u ? "class" : "color"]), i.bg || (i.bg = A[0][0][u ? "class" : "color"]);
|
|
436
436
|
var k = i.fg;
|
|
437
437
|
i.fg = i.bg, i.bg = k;
|
|
438
|
-
var
|
|
439
|
-
return i.fg_truecolor = i.bg_truecolor, i.bg_truecolor =
|
|
438
|
+
var h = i.fg_truecolor;
|
|
439
|
+
return i.fg_truecolor = i.bg_truecolor, i.bg_truecolor = h, i.isInverted = !0, !1;
|
|
440
440
|
}
|
|
441
441
|
return !0;
|
|
442
442
|
}), s.json)
|
|
@@ -445,19 +445,19 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
445
445
|
return "";
|
|
446
446
|
if (!i.was_processed)
|
|
447
447
|
return i.content;
|
|
448
|
-
var c = [], o = [], r = [],
|
|
449
|
-
var
|
|
450
|
-
for (
|
|
451
|
-
k.hasOwnProperty(
|
|
452
|
-
return
|
|
448
|
+
var c = [], o = [], r = [], _ = {}, a = function(k) {
|
|
449
|
+
var h = [], $ = void 0;
|
|
450
|
+
for ($ in k)
|
|
451
|
+
k.hasOwnProperty($) && h.push("data-" + $ + '="' + y.escapeForHtml(k[$]) + '"');
|
|
452
|
+
return h.length > 0 ? " " + h.join(" ") : "";
|
|
453
453
|
};
|
|
454
|
-
return i.isInverted && (
|
|
454
|
+
return i.isInverted && (_["ansi-is-inverted"] = "true"), i.fg && (u ? (c.push(i.fg + "-fg"), i.fg_truecolor !== null && (_["ansi-truecolor-fg"] = i.fg_truecolor, i.fg_truecolor = null)) : c.push("color:rgb(" + i.fg + ")")), i.bg && (u ? (c.push(i.bg + "-bg"), i.bg_truecolor !== null && (_["ansi-truecolor-bg"] = i.bg_truecolor, i.bg_truecolor = null)) : c.push("background-color:rgb(" + i.bg + ")")), i.decorations.forEach(function(v) {
|
|
455
455
|
if (u) {
|
|
456
456
|
o.push("ansi-" + v);
|
|
457
457
|
return;
|
|
458
458
|
}
|
|
459
459
|
v === "bold" ? o.push("font-weight:bold") : v === "dim" ? o.push("opacity:0.5") : v === "italic" ? o.push("font-style:italic") : v === "hidden" ? o.push("visibility:hidden") : v === "strikethrough" ? r.push("line-through") : r.push(v);
|
|
460
|
-
}), r.length && o.push("text-decoration:" + r.join(" ")), u ? '<span class="' + c.concat(o).join(" ") + '"' + a(
|
|
460
|
+
}), r.length && o.push("text-decoration:" + r.join(" ")), u ? '<span class="' + c.concat(o).join(" ") + '"' + a(_) + ">" + i.content + "</span>" : '<span style="' + c.concat(o).join(";") + '"' + a(_) + ">" + i.content + "</span>";
|
|
461
461
|
}
|
|
462
462
|
}, {
|
|
463
463
|
key: "removeDecoration",
|
|
@@ -555,9 +555,9 @@ function it(e, t, n, s) {
|
|
|
555
555
|
const i = [], u = /(\s|^)(https?:\/\/(?:www\.|(?!www))[^\s.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/g;
|
|
556
556
|
let c = 0, o;
|
|
557
557
|
for (; (o = u.exec(n.content)) !== null; ) {
|
|
558
|
-
const [, r,
|
|
558
|
+
const [, r, _] = o, a = o.index + r.length;
|
|
559
559
|
a > c && i.push(n.content.substring(c, a));
|
|
560
|
-
const v =
|
|
560
|
+
const v = _.startsWith("www.") ? `http://${_}` : _;
|
|
561
561
|
i.push(
|
|
562
562
|
z.createElement(
|
|
563
563
|
"a",
|
|
@@ -566,7 +566,7 @@ function it(e, t, n, s) {
|
|
|
566
566
|
href: v,
|
|
567
567
|
target: "_blank"
|
|
568
568
|
},
|
|
569
|
-
`${
|
|
569
|
+
`${_}`
|
|
570
570
|
)
|
|
571
571
|
), c = u.lastIndex;
|
|
572
572
|
}
|
|
@@ -639,7 +639,7 @@ function ot({ value: e, prefix: t, onChange: n, onKeyUp: s, onKeyDown: f, inputR
|
|
|
639
639
|
}
|
|
640
640
|
const U = "user", Y = "prozilla-os", mt = 50, ye = `${b.fg.cyan + b.decoration.dim}$APP_NAME - Made by Prozilla${b.reset}
|
|
641
641
|
${b.decoration.dim}Type 'help' for a list of commands.${b.reset}
|
|
642
|
-
`,
|
|
642
|
+
`, E = b.fg.cyan, pt = `
|
|
643
643
|
:.
|
|
644
644
|
-==.
|
|
645
645
|
.=====:
|
|
@@ -647,10 +647,10 @@ ${b.decoration.dim}Type 'help' for a list of commands.${b.reset}
|
|
|
647
647
|
:===+=----------::..
|
|
648
648
|
=+=---------------:..
|
|
649
649
|
--------------------:.
|
|
650
|
-
.:-+=----${b.fg.white}*###*${
|
|
651
|
-
:==+----${b.fg.white}#%+${
|
|
652
|
-
.=----${b.fg.white}#%+${
|
|
653
|
-
==----${b.fg.white}*###*${
|
|
650
|
+
.:-+=----${b.fg.white}*###*${E}--${b.fg.white}*####=${E}---.
|
|
651
|
+
:==+----${b.fg.white}#%+${E}-${b.fg.white}+%#${E}-${b.fg.white}##%*+${E}----:.
|
|
652
|
+
.=----${b.fg.white}#%+${E}-${b.fg.white}+%#${E}-${b.fg.white}*+${E}-${b.fg.white}%#+${E}---:.
|
|
653
|
+
==----${b.fg.white}*###*${E}--${b.fg.white}*###*${E}----.
|
|
654
654
|
==+-------------------:.
|
|
655
655
|
...::---------------:.
|
|
656
656
|
.::---------::..
|
|
@@ -682,7 +682,7 @@ function dt(e) {
|
|
|
682
682
|
return e.replace(/\u001b\[([0-9]+)m/gm, "");
|
|
683
683
|
}
|
|
684
684
|
let G = [];
|
|
685
|
-
const we = /* @__PURE__ */ Object.assign({ "./commands/cat.ts": () => import("./cat-
|
|
685
|
+
const we = /* @__PURE__ */ Object.assign({ "./commands/cat.ts": () => import("./cat-FW5-WCC9.js"), "./commands/cd.ts": () => import("./cd-CJ_-Ao6a.js"), "./commands/clear.ts": () => import("./clear-DtYBxmDr.js"), "./commands/cmatrix.ts": () => import("./cmatrix-Dp2xw_1D.js"), "./commands/compgen.ts": () => import("./compgen-yV_rUCTl.js"), "./commands/cowsay.ts": () => import("./cowsay-DhGebg2w.js"), "./commands/dir.ts": () => import("./dir-BlrznBqV.js"), "./commands/echo.ts": () => import("./echo-PyZ6XYF6.js"), "./commands/eval.ts": () => import("./eval-CnKC-mrj.js"), "./commands/exit.ts": () => import("./exit-CizX3N_u.js"), "./commands/fortune.ts": () => import("./fortune-DNnPar5a.js"), "./commands/help.ts": () => import("./help-K3OSEH-4.js"), "./commands/hostname.ts": () => import("./hostname-BBOQWx6L.js"), "./commands/lolcat.ts": () => import("./lolcat-e6AdhtPY.js"), "./commands/ls.ts": () => import("./ls-Cv8zACh_.js"), "./commands/make.ts": () => import("./make-Cr6zPi10.js"), "./commands/man.ts": () => import("./man-B0gSJec-.js"), "./commands/mkdir.ts": () => import("./mkdir-BTSAC1PK.js"), "./commands/neofetch.ts": () => import("./neofetch-Cq2qUtOn.js"), "./commands/pwd.ts": () => import("./pwd-CSapfDtw.js"), "./commands/reboot.ts": () => import("./reboot-Bwxhoa8q.js"), "./commands/reload.ts": () => import("./reload-BMeeiK59.js"), "./commands/rev.ts": () => import("./rev-C8qQIyj_.js"), "./commands/rm.ts": () => import("./rm-DrsNwyIE.js"), "./commands/rmdir.ts": () => import("./rmdir-BZAP4H6B.js"), "./commands/sl.ts": () => import("./sl-iFJMGBu9.js"), "./commands/touch.ts": () => import("./touch-4AvKZiqp.js"), "./commands/uptime.ts": () => import("./uptime-BYmCcOUM.js"), "./commands/whatis.ts": () => import("./whatis-iNlzdd4F.js"), "./commands/whoami.ts": () => import("./whoami-CQNGmqxL.js") }), Ce = () => {
|
|
686
686
|
G = [];
|
|
687
687
|
for (const e in we)
|
|
688
688
|
we[e]().then((t) => {
|
|
@@ -714,15 +714,15 @@ const B = class B {
|
|
|
714
714
|
W(B, "COMMANDS", G);
|
|
715
715
|
let ee = B;
|
|
716
716
|
function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus: i }) {
|
|
717
|
-
const u = He(), [c, o] = S(0), [r,
|
|
717
|
+
const u = He(), [c, o] = S(0), [r, _] = S(n ?? ""), [a, v] = S([{
|
|
718
718
|
text: e ? ye.replace("$APP_NAME", e.name) : ye,
|
|
719
719
|
isInput: !1
|
|
720
|
-
}]), k = Re(), [
|
|
720
|
+
}]), k = Re(), [h, $] = S(k == null ? void 0 : k.navigate(t ?? "~")), O = de(null), [M, D] = S(0), [T, K] = S(null), [X, ne] = S(null), H = de(null), [re, ie] = S(!1), Ee = je();
|
|
721
721
|
q(() => {
|
|
722
|
-
|
|
723
|
-
}, [
|
|
724
|
-
|
|
725
|
-
}, [
|
|
722
|
+
h != null && (s == null || s(`${U}@${Y}: ${h.root ? "/" : h.path}`));
|
|
723
|
+
}, [h == null ? void 0 : h.path, h == null ? void 0 : h.root, s]), q(() => {
|
|
724
|
+
!O.current || !y || O.current.focus();
|
|
725
|
+
}, [O, y]);
|
|
726
726
|
const ae = () => {
|
|
727
727
|
H.current.scrollTop = H.current.scrollHeight;
|
|
728
728
|
};
|
|
@@ -731,7 +731,7 @@ function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus
|
|
|
731
731
|
}, [re, X, H]), q(() => {
|
|
732
732
|
H.current == null || T != null || ae();
|
|
733
733
|
}, [r]);
|
|
734
|
-
const oe = `${b.fg.cyan + U}@${Y + b.reset}:${b.fg.blue + (
|
|
734
|
+
const oe = `${b.fg.cyan + U}@${Y + b.reset}:${b.fg.blue + (h != null && h.root || h == null ? "/" : h == null ? void 0 : h.path) + b.reset}$ `, le = a, Q = (l) => {
|
|
735
735
|
le.push(l), v(le);
|
|
736
736
|
}, J = (l) => {
|
|
737
737
|
Q({
|
|
@@ -740,13 +740,13 @@ function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus
|
|
|
740
740
|
});
|
|
741
741
|
}, $e = (l, p) => {
|
|
742
742
|
K(l), ie(!1);
|
|
743
|
-
const
|
|
744
|
-
y && (
|
|
743
|
+
const g = (d) => {
|
|
744
|
+
y && (d.ctrlKey || d.metaKey) && d.key === "c" && l.stop();
|
|
745
745
|
};
|
|
746
746
|
let m = null;
|
|
747
|
-
l.on(P.EVENT_NAMES.new, (
|
|
747
|
+
l.on(P.EVENT_NAMES.new, (d) => {
|
|
748
748
|
(async () => {
|
|
749
|
-
let w =
|
|
749
|
+
let w = d;
|
|
750
750
|
for (const I of p)
|
|
751
751
|
w instanceof P || (w = await ce(w ? `${I} ${w}` : I));
|
|
752
752
|
if (w instanceof P) {
|
|
@@ -756,54 +756,55 @@ function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus
|
|
|
756
756
|
m = w, ne(w);
|
|
757
757
|
})();
|
|
758
758
|
}), l.on(P.EVENT_NAMES.stop, () => {
|
|
759
|
-
document.removeEventListener("keydown",
|
|
760
|
-
}), document.addEventListener("keydown",
|
|
759
|
+
document.removeEventListener("keydown", g), J(m), K(null), ne(null);
|
|
760
|
+
}), document.addEventListener("keydown", g);
|
|
761
761
|
}, ce = async (l) => {
|
|
762
|
-
var
|
|
763
|
-
const p = l.indexOf(" ") + 1,
|
|
762
|
+
var he;
|
|
763
|
+
const p = l.indexOf(" ") + 1, g = p <= 0 ? "" : l.substr(p), m = Date.now();
|
|
764
764
|
if (l = l.trim(), l === "") return;
|
|
765
|
-
|
|
766
|
-
if (
|
|
767
|
-
|
|
768
|
-
const w = (
|
|
765
|
+
let d = l.match(/(?:[^\s"]+|"[^"]*")+/g);
|
|
766
|
+
if (d == null) return;
|
|
767
|
+
d[0].toLowerCase() === "sudo" && d.length >= 2 && d.shift();
|
|
768
|
+
const w = (he = d.shift()) == null ? void 0 : he.toLowerCase();
|
|
769
769
|
if (w == null) return;
|
|
770
770
|
const I = ee.find(w);
|
|
771
771
|
if (!I) return F(w, "Command not found");
|
|
772
|
+
d = d.map((C) => C.startsWith('"') && C.endsWith('"') ? C.slice(1, -1) : C);
|
|
772
773
|
const R = [], fe = {};
|
|
773
|
-
if (
|
|
774
|
-
const
|
|
774
|
+
if (d.filter((C) => C.startsWith("-")).forEach((C) => {
|
|
775
|
+
const ge = (x) => {
|
|
775
776
|
if (R.includes(x))
|
|
776
777
|
return;
|
|
777
778
|
R.push(x);
|
|
778
779
|
const j = I.getOption(R[R.length - 1]);
|
|
779
780
|
if (j != null && j.isInput) {
|
|
780
|
-
const me =
|
|
781
|
-
fe[j.short] = me, pe(me,
|
|
781
|
+
const me = d[d.indexOf(C) + 1];
|
|
782
|
+
fe[j.short] = me, pe(me, d);
|
|
782
783
|
}
|
|
783
784
|
};
|
|
784
|
-
if (
|
|
785
|
-
const x =
|
|
786
|
-
|
|
785
|
+
if (C.startsWith("--")) {
|
|
786
|
+
const x = C.substring(2).toLowerCase();
|
|
787
|
+
ge(x);
|
|
787
788
|
} else
|
|
788
|
-
|
|
789
|
-
|
|
789
|
+
C.substring(1).split("").forEach((j) => {
|
|
790
|
+
ge(j);
|
|
790
791
|
});
|
|
791
|
-
pe(
|
|
792
|
-
}), I.requireArgs &&
|
|
792
|
+
pe(C, d);
|
|
793
|
+
}), I.requireArgs && d.length === 0)
|
|
793
794
|
return F(w, `Incorrect usage: ${w} requires at least 1 argument`);
|
|
794
795
|
if (I.requireOptions && R.length === 0)
|
|
795
796
|
return F(w, `Incorrect usage: ${w} requires at least 1 option`);
|
|
796
797
|
let V = null;
|
|
797
798
|
try {
|
|
798
|
-
if (V = await I.execute(
|
|
799
|
+
if (V = await I.execute(d, {
|
|
799
800
|
promptOutput: J,
|
|
800
801
|
pushHistory: Q,
|
|
801
802
|
virtualRoot: k,
|
|
802
|
-
currentDirectory:
|
|
803
|
-
setCurrentDirectory:
|
|
803
|
+
currentDirectory: h,
|
|
804
|
+
setCurrentDirectory: $,
|
|
804
805
|
username: U,
|
|
805
806
|
hostname: Y,
|
|
806
|
-
rawInputValue:
|
|
807
|
+
rawInputValue: g,
|
|
807
808
|
options: R,
|
|
808
809
|
exit: f,
|
|
809
810
|
inputs: fe,
|
|
@@ -815,11 +816,11 @@ function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus
|
|
|
815
816
|
return F(w, "Command failed");
|
|
816
817
|
if (!V.blank)
|
|
817
818
|
return V;
|
|
818
|
-
} catch (
|
|
819
|
-
return console.error(
|
|
819
|
+
} catch (C) {
|
|
820
|
+
return console.error(C), F(w, "Command failed");
|
|
820
821
|
}
|
|
821
822
|
}, Oe = () => {
|
|
822
|
-
|
|
823
|
+
_(""), D(0);
|
|
823
824
|
}, Se = async (l) => {
|
|
824
825
|
Q({
|
|
825
826
|
text: oe + l,
|
|
@@ -827,35 +828,35 @@ function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus
|
|
|
827
828
|
value: l
|
|
828
829
|
});
|
|
829
830
|
let p = l.split(" | ");
|
|
830
|
-
const
|
|
831
|
+
const g = [];
|
|
831
832
|
let m = null;
|
|
832
|
-
for (const
|
|
833
|
-
m instanceof P || (m = await ce(m ? `${
|
|
834
|
-
Oe(), p = p.filter((
|
|
833
|
+
for (const d of p)
|
|
834
|
+
m instanceof P || (m = await ce(m ? `${d} ${m}` : d), g.push(d));
|
|
835
|
+
Oe(), p = p.filter((d) => !g.includes(d)), m && (m instanceof P ? $e(m, p) : J(`${m}
|
|
835
836
|
`));
|
|
836
837
|
}, ue = (l) => {
|
|
837
|
-
const p = a.filter(({ isInput: m }) => m),
|
|
838
|
-
if (
|
|
839
|
-
l < 0 &&
|
|
838
|
+
const p = a.filter(({ isInput: m }) => m), g = xe(M + l, 0, p.length);
|
|
839
|
+
if (g === M) {
|
|
840
|
+
l < 0 && _("");
|
|
840
841
|
return;
|
|
841
842
|
}
|
|
842
|
-
|
|
843
|
+
_(g === 0 ? "" : p[p.length - g].value ?? ""), D(g);
|
|
843
844
|
}, Te = (l) => {
|
|
844
|
-
const p = l.target.value, { key:
|
|
845
|
-
|
|
845
|
+
const p = l.target.value, { key: g } = l;
|
|
846
|
+
g === "Enter" ? (Se(p), o((m) => m + 1)) : g === "ArrowUp" ? (l.preventDefault(), ue(1)) : g === "ArrowDown" ? (l.preventDefault(), ue(-1)) : !T && (l.ctrlKey || l.metaKey) && g === "c" && _((m) => m + "^C");
|
|
846
847
|
}, Ie = (l) => {
|
|
847
848
|
const p = l.target.value;
|
|
848
|
-
return
|
|
849
|
+
return _(p);
|
|
849
850
|
}, Ae = () => {
|
|
850
851
|
const l = a.slice(-16);
|
|
851
852
|
let p = 0;
|
|
852
|
-
return l.forEach((
|
|
853
|
-
|
|
854
|
-
}), l.slice(p).map(({ text:
|
|
853
|
+
return l.forEach((g, m) => {
|
|
854
|
+
g.clear && (p = m + 1);
|
|
855
|
+
}), l.slice(p).map(({ text: g }, m) => /* @__PURE__ */ L(ve, { text: g }, m));
|
|
855
856
|
}, Le = (l) => {
|
|
856
|
-
var p,
|
|
857
|
-
i == null || i(l), l.button === 2 && (l.preventDefault(), (
|
|
858
|
-
|
|
857
|
+
var p, g;
|
|
858
|
+
i == null || i(l), l.button === 2 && (l.preventDefault(), (g = (p = navigator.clipboard).readText) == null || g.call(p).then((m) => {
|
|
859
|
+
_(r + m);
|
|
859
860
|
}).catch((m) => {
|
|
860
861
|
console.error(m);
|
|
861
862
|
}));
|
|
@@ -870,8 +871,8 @@ function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus
|
|
|
870
871
|
onMouseDown: Le,
|
|
871
872
|
onContextMenu: Ne,
|
|
872
873
|
onClick: (l) => {
|
|
873
|
-
var p,
|
|
874
|
-
((p = window.getSelection()) == null ? void 0 : p.toString()) === "" && (l.preventDefault(), (
|
|
874
|
+
var p, g;
|
|
875
|
+
((p = window.getSelection()) == null ? void 0 : p.toString()) === "" && (l.preventDefault(), (g = O.current) == null || g.focus());
|
|
875
876
|
},
|
|
876
877
|
children: [
|
|
877
878
|
Ae(),
|
|
@@ -882,7 +883,7 @@ function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus
|
|
|
882
883
|
prefix: oe,
|
|
883
884
|
onKeyDown: Te,
|
|
884
885
|
onChange: Ie,
|
|
885
|
-
inputRef:
|
|
886
|
+
inputRef: O
|
|
886
887
|
},
|
|
887
888
|
c
|
|
888
889
|
)
|
|
@@ -892,7 +893,7 @@ function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus
|
|
|
892
893
|
}
|
|
893
894
|
const _t = new Fe("Terminal", "terminal", ct).setIconUrl("https://os.prozilla.dev/assets/apps/icons/terminal.svg").setRole(Je.APP_ROLES.Terminal);
|
|
894
895
|
export {
|
|
895
|
-
|
|
896
|
+
E as A,
|
|
896
897
|
ee as C,
|
|
897
898
|
mt as M,
|
|
898
899
|
P as S,
|
|
@@ -901,4 +902,4 @@ export {
|
|
|
901
902
|
dt as r,
|
|
902
903
|
_t as t
|
|
903
904
|
};
|
|
904
|
-
//# sourceMappingURL=main-
|
|
905
|
+
//# sourceMappingURL=main-BY8DgnTe.js.map
|