@sourcegraph/amp 0.0.1749196899-g16ba82 → 0.0.1749225700-gc8788d
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/amp.js +3 -3
- package/dist/{client-D1Pmx669.js → client-D0gbNDFf.js} +2 -2
- package/dist/{client-D1Pmx669.js.map → client-D0gbNDFf.js.map} +1 -1
- package/dist/{console-DZmALLuA.js → console-CDi5rFHv.js} +55 -44
- package/dist/console-CDi5rFHv.js.map +1 -0
- package/dist/{create_file.node-CygrebBY.js → create_file.node-DL2WuEa4.js} +2 -2
- package/dist/{create_file.node-CygrebBY.js.map → create_file.node-DL2WuEa4.js.map} +1 -1
- package/dist/{edit_file.node-D_cMkiLI.js → edit_file.node-SSEQ1h3o.js} +3 -3
- package/dist/{edit_file.node-D_cMkiLI.js.map → edit_file.node-SSEQ1h3o.js.map} +1 -1
- package/dist/{executable-C8qYZU1W.js → executable-CxioKGk7.js} +2 -2
- package/dist/{executable-C8qYZU1W.js.map → executable-CxioKGk7.js.map} +1 -1
- package/dist/{files--h2VjD8F.js → files-BQmddBey.js} +2 -2
- package/dist/{files--h2VjD8F.js.map → files-BQmddBey.js.map} +1 -1
- package/dist/fuzzy-server.js +116 -113
- package/dist/fuzzy-server.js.map +1 -1
- package/dist/{glob.node-AB34HaNl.js → glob.node-C8xrYICA.js} +4 -4
- package/dist/{glob.node-AB34HaNl.js.map → glob.node-C8xrYICA.js.map} +1 -1
- package/dist/{index-nQBDDlvh.js → index-BY5vhogw.js} +2 -2
- package/dist/{index-nQBDDlvh.js.map → index-BY5vhogw.js.map} +1 -1
- package/dist/{list_directory.node-DZamBwOx.js → list_directory.node-p_ArdqyT.js} +2 -2
- package/dist/{list_directory.node-DZamBwOx.js.map → list_directory.node-p_ArdqyT.js.map} +1 -1
- package/dist/{load-profile-DzDzDOIq.js → load-profile-DxrviVkC.js} +2 -2
- package/dist/{load-profile-DzDzDOIq.js.map → load-profile-DxrviVkC.js.map} +1 -1
- package/dist/{main-WXbdYG4Z.js → main-DIn8dJ9L.js} +409 -398
- package/dist/{main-WXbdYG4Z.js.map → main-DIn8dJ9L.js.map} +1 -1
- package/dist/{node-CBRPqFin.js → node-C9D1REPh.js} +374 -320
- package/dist/node-C9D1REPh.js.map +1 -0
- package/dist/{node-D2Ho0W-v.js → node-CHCdepF2.js} +3 -3
- package/dist/{node-D2Ho0W-v.js.map → node-CHCdepF2.js.map} +1 -1
- package/dist/{node-B9XNCq_w.js → node-CU0lZEVr.js} +2 -2
- package/dist/{node-B9XNCq_w.js.map → node-CU0lZEVr.js.map} +1 -1
- package/dist/{node-CUCcBUhU.js → node-CrPwEb6e.js} +4 -4
- package/dist/{node-CUCcBUhU.js.map → node-CrPwEb6e.js.map} +1 -1
- package/dist/{node-Cs3K2AKs.js → node-D-xGtMhE.js} +3 -3
- package/dist/{node-Cs3K2AKs.js.map → node-D-xGtMhE.js.map} +1 -1
- package/dist/{node-SvjAOtkw.js → node-DQLcKPbG.js} +2 -2
- package/dist/{node-SvjAOtkw.js.map → node-DQLcKPbG.js.map} +1 -1
- package/dist/{read_file.node-CveQp78z.js → read_file.node-DTbjOJwN.js} +2 -2
- package/dist/{read_file.node-CveQp78z.js.map → read_file.node-DTbjOJwN.js.map} +1 -1
- package/dist/{stdio-CRvROLK4.js → stdio-DuUbi3RX.js} +3 -3
- package/dist/{stdio-CRvROLK4.js.map → stdio-DuUbi3RX.js.map} +1 -1
- package/dist/storybook.js +1 -1
- package/dist/{undo_edit.node-C3I02TEE.js → undo_edit.node-qujh3sgI.js} +2 -2
- package/dist/{undo_edit.node-C3I02TEE.js.map → undo_edit.node-qujh3sgI.js.map} +1 -1
- package/package.json +1 -1
- package/dist/console-DZmALLuA.js.map +0 -1
- package/dist/node-CBRPqFin.js.map +0 -1
@@ -1,9 +1,10 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
import * as
|
3
|
-
import ee, { resolve as
|
4
|
-
import { aT as
|
5
|
-
import { loadProfileEnvironmentVariables as
|
6
|
-
const
|
2
|
+
import * as le from "node:os";
|
3
|
+
import ee, { resolve as fe } from "node:path";
|
4
|
+
import { aT as de, aU as _e, C as pe, aV as ne, aW as ge, aX as ve, aI as oe, aQ as me, aH as be, aC as Se, O as se } from "./console-CDi5rFHv.js";
|
5
|
+
import { loadProfileEnvironmentVariables as Ce } from "./load-profile-DxrviVkC.js";
|
6
|
+
const ye = [
|
7
|
+
// Basic read/info operations
|
7
8
|
"ls",
|
8
9
|
"dir",
|
9
10
|
"find",
|
@@ -25,8 +26,6 @@ const Ce = [
|
|
25
26
|
"ps",
|
26
27
|
"top",
|
27
28
|
"htop",
|
28
|
-
"uname",
|
29
|
-
"whoami",
|
30
29
|
"echo",
|
31
30
|
"printenv",
|
32
31
|
"id",
|
@@ -48,68 +47,56 @@ const Ce = [
|
|
48
47
|
"man",
|
49
48
|
"info",
|
50
49
|
"mkdir",
|
51
|
-
"touch"
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
"go run",
|
56
|
-
"go build",
|
57
|
-
"go vet",
|
58
|
-
"go fmt",
|
59
|
-
"go list",
|
50
|
+
"touch",
|
51
|
+
"uname",
|
52
|
+
"whoami",
|
53
|
+
// Go
|
60
54
|
"go version",
|
61
55
|
"go env",
|
62
|
-
|
63
|
-
|
64
|
-
"cargo run",
|
65
|
-
"cargo build",
|
66
|
-
"cargo check",
|
67
|
-
"cargo fmt",
|
56
|
+
"go help",
|
57
|
+
// Cargo
|
68
58
|
"cargo version",
|
69
|
-
"cargo
|
59
|
+
"cargo --version",
|
60
|
+
"cargo help",
|
70
61
|
// Rust
|
71
62
|
"rustc --version",
|
63
|
+
"rustc --help",
|
72
64
|
"rustc --explain",
|
73
65
|
// Java
|
74
66
|
"javac --version",
|
75
67
|
"javac -version",
|
76
68
|
"javac -help",
|
77
|
-
|
78
|
-
"make -n",
|
79
|
-
"make --dry-run",
|
80
|
-
// Maven
|
81
|
-
"mvn test",
|
82
|
-
"mvn verify",
|
83
|
-
"mvn help",
|
84
|
-
"mvn dependency:tree",
|
85
|
-
// Gradle
|
86
|
-
"gradle tasks",
|
87
|
-
"gradle dependencies",
|
88
|
-
"gradle properties",
|
89
|
-
"gradle help",
|
69
|
+
"javac --help",
|
90
70
|
// .NET
|
91
|
-
"dotnet test",
|
92
|
-
"dotnet list",
|
93
71
|
"dotnet --info",
|
94
72
|
"dotnet --version",
|
95
73
|
"dotnet --help",
|
74
|
+
"dotnet help",
|
96
75
|
// C/C++
|
97
76
|
"gcc --version",
|
98
77
|
"gcc -v",
|
78
|
+
"gcc --help",
|
99
79
|
"gcc -dumpversion",
|
100
80
|
"g++ --version",
|
101
81
|
"g++ -v",
|
82
|
+
"g++ --help",
|
102
83
|
"g++ -dumpversion",
|
84
|
+
"clang --version",
|
85
|
+
"clang --help",
|
86
|
+
"clang++ --version",
|
87
|
+
"clang++ --help",
|
103
88
|
// Python
|
104
89
|
"python -V",
|
105
90
|
"python --version",
|
106
91
|
"python -h",
|
107
92
|
"python --help",
|
108
|
-
"
|
93
|
+
"python3 -V",
|
94
|
+
"python3 --version",
|
95
|
+
"python3 -h",
|
96
|
+
"python3 --help",
|
109
97
|
// Ruby
|
110
98
|
"ruby -v",
|
111
99
|
"ruby --version",
|
112
|
-
"ruby -e",
|
113
100
|
"ruby -h",
|
114
101
|
"ruby --help",
|
115
102
|
// Node
|
@@ -117,6 +104,76 @@ const Ce = [
|
|
117
104
|
"node --version",
|
118
105
|
"node -h",
|
119
106
|
"node --help",
|
107
|
+
// npm
|
108
|
+
"npm --help",
|
109
|
+
"npm --version",
|
110
|
+
"npm -v",
|
111
|
+
"npm help",
|
112
|
+
// yarn
|
113
|
+
"yarn --help",
|
114
|
+
"yarn --version",
|
115
|
+
"yarn -v",
|
116
|
+
"yarn help",
|
117
|
+
// pnpm
|
118
|
+
"pnpm --help",
|
119
|
+
"pnpm --version",
|
120
|
+
"pnpm -v",
|
121
|
+
"pnpm help",
|
122
|
+
// Testing
|
123
|
+
"pytest -h",
|
124
|
+
"pytest --help",
|
125
|
+
"pytest --version",
|
126
|
+
"jest --help",
|
127
|
+
"jest --version",
|
128
|
+
"mocha --help",
|
129
|
+
"mocha --version",
|
130
|
+
// Make
|
131
|
+
"make --version",
|
132
|
+
"make --help",
|
133
|
+
// Docker
|
134
|
+
"docker --version",
|
135
|
+
"docker --help",
|
136
|
+
"docker version",
|
137
|
+
"docker help",
|
138
|
+
// Git
|
139
|
+
"git --version",
|
140
|
+
"git --help",
|
141
|
+
"git help",
|
142
|
+
"git version"
|
143
|
+
], ae = [
|
144
|
+
// Go commands
|
145
|
+
"go test",
|
146
|
+
"go run",
|
147
|
+
"go build",
|
148
|
+
"go vet",
|
149
|
+
"go fmt",
|
150
|
+
"go list",
|
151
|
+
// Cargo commands
|
152
|
+
"cargo test",
|
153
|
+
"cargo run",
|
154
|
+
"cargo build",
|
155
|
+
"cargo check",
|
156
|
+
"cargo fmt",
|
157
|
+
"cargo tree",
|
158
|
+
// Make (only dry runs)
|
159
|
+
"make -n",
|
160
|
+
"make --dry-run",
|
161
|
+
// Maven
|
162
|
+
"mvn test",
|
163
|
+
"mvn verify",
|
164
|
+
"mvn dependency:tree",
|
165
|
+
// Gradle
|
166
|
+
"gradle tasks",
|
167
|
+
"gradle dependencies",
|
168
|
+
"gradle properties",
|
169
|
+
// .NET
|
170
|
+
"dotnet test",
|
171
|
+
"dotnet list",
|
172
|
+
// Python
|
173
|
+
"python -c",
|
174
|
+
// Ruby
|
175
|
+
"ruby -e",
|
176
|
+
// Node
|
120
177
|
"node -e",
|
121
178
|
// npm
|
122
179
|
"npm list",
|
@@ -126,7 +183,6 @@ const Ce = [
|
|
126
183
|
"npm run",
|
127
184
|
"npm view",
|
128
185
|
"npm info",
|
129
|
-
"npm --help",
|
130
186
|
// yarn
|
131
187
|
"yarn list",
|
132
188
|
"yarn ls",
|
@@ -134,43 +190,17 @@ const Ce = [
|
|
134
190
|
"yarn test",
|
135
191
|
"yarn run",
|
136
192
|
"yarn why",
|
137
|
-
"yarn --help",
|
138
193
|
// pnpm
|
139
194
|
"pnpm list",
|
140
195
|
"pnpm ls",
|
141
196
|
"pnpm outdated",
|
142
197
|
"pnpm test",
|
143
198
|
"pnpm run",
|
144
|
-
"pnpm --help",
|
145
|
-
"pnpm run build",
|
146
|
-
"pnpm run check",
|
147
|
-
"pnpm run check:fix",
|
148
|
-
"pnpm run test",
|
149
|
-
"pnpm -w build",
|
150
|
-
"pnpm -w check",
|
151
|
-
"pnpm -w check:fix",
|
152
|
-
"pnpm -w test",
|
153
|
-
"pnpm build",
|
154
|
-
"pnpm check",
|
155
|
-
"pnpm check:fix",
|
156
|
-
"pnpm test",
|
157
|
-
"pnpm -w run build",
|
158
|
-
"pnpm -w run check",
|
159
|
-
"pnpm -w run check:fix",
|
160
|
-
"pnpm -w run test",
|
161
|
-
"pnpm --version",
|
162
199
|
// Testing
|
163
200
|
"pytest --collect-only",
|
164
|
-
"pytest -h",
|
165
|
-
"pytest --help",
|
166
|
-
"pytest --version",
|
167
201
|
"jest --listTests",
|
168
202
|
"jest --showConfig",
|
169
|
-
"jest --help",
|
170
|
-
"jest --version",
|
171
203
|
"mocha --list",
|
172
|
-
"mocha --help",
|
173
|
-
"mocha --version",
|
174
204
|
// Git
|
175
205
|
"git status",
|
176
206
|
"git show",
|
@@ -182,100 +212,124 @@ const Ce = [
|
|
182
212
|
"git rev-parse --is-inside-work-tree",
|
183
213
|
"git rev-parse --show-toplevel",
|
184
214
|
"git config --list",
|
185
|
-
"git log"
|
186
|
-
// Go specific commands
|
187
|
-
"go build .",
|
188
|
-
"go test"
|
215
|
+
"git log"
|
189
216
|
], we = ["/dev/null", "/dev/zero", "/dev/stdout", "/dev/stderr", "/dev/stdin"];
|
190
|
-
function
|
191
|
-
if (!
|
217
|
+
function ue(L, O) {
|
218
|
+
if (!L || we.includes(L) || (L.endsWith(ee.sep) && (L = L.slice(0, -1)), O.includes(L)))
|
192
219
|
return !1;
|
193
|
-
if (ee.isAbsolute(
|
194
|
-
return !
|
195
|
-
const
|
196
|
-
let
|
197
|
-
for (const
|
198
|
-
if (
|
199
|
-
if (
|
220
|
+
if (ee.isAbsolute(L))
|
221
|
+
return !O.some((R) => Be(R, L));
|
222
|
+
const I = L.split("/");
|
223
|
+
let k = 0;
|
224
|
+
for (const R of I)
|
225
|
+
if (R === "..") {
|
226
|
+
if (k--, k < 0)
|
200
227
|
return !0;
|
201
|
-
} else
|
228
|
+
} else R !== "" && R !== "." && k++;
|
202
229
|
return !1;
|
203
230
|
}
|
204
|
-
function Be(
|
205
|
-
const
|
206
|
-
return !!
|
231
|
+
function Be(L, O) {
|
232
|
+
const I = ee.relative(ee.normalize(L), ee.normalize(O));
|
233
|
+
return !!I && !I.startsWith("..") && !I.startsWith("/");
|
207
234
|
}
|
208
|
-
function re(
|
209
|
-
if (typeof
|
235
|
+
function re(L, O, I) {
|
236
|
+
if (typeof L == "string")
|
210
237
|
return !1;
|
211
|
-
for (const
|
212
|
-
if (typeof
|
238
|
+
for (const k of L.arguments)
|
239
|
+
if (typeof k == "string" && !(k.startsWith("-") || k.includes("*") || k.startsWith('"') || k.startsWith("'")) && !(I && !I.absolutePaths && k.startsWith("//")) && k.includes("/") && ue(k, O))
|
213
240
|
return !0;
|
214
241
|
return !1;
|
215
242
|
}
|
216
|
-
function Ee(
|
217
|
-
const
|
243
|
+
function Ee(L, O = !1) {
|
244
|
+
const I = {
|
218
245
|
absolutePaths: !0,
|
219
246
|
environmentVariables: !0
|
220
247
|
};
|
221
|
-
if (
|
222
|
-
return
|
223
|
-
const
|
224
|
-
return
|
225
|
-
...
|
248
|
+
if (O || typeof L == "string")
|
249
|
+
return I;
|
250
|
+
const k = typeof L.program == "string" ? L.program.toLowerCase() : "", R = L.arguments.filter((N) => typeof N == "string").join(" "), q = `${k} ${R}`.toLowerCase();
|
251
|
+
return k.includes("bazel") || q.includes("bazel") || k === "ibazel" ? {
|
252
|
+
...I,
|
226
253
|
absolutePaths: !1
|
227
254
|
// Allow bazel-style absolute paths like //path/to/target
|
228
|
-
} :
|
255
|
+
} : I;
|
256
|
+
}
|
257
|
+
function Ae(L) {
|
258
|
+
for (const O of ye)
|
259
|
+
if (L === O || L.startsWith(O + " "))
|
260
|
+
return !0;
|
261
|
+
return !1;
|
229
262
|
}
|
230
|
-
function
|
231
|
-
|
263
|
+
function Te(L) {
|
264
|
+
const O = /* @__PURE__ */ new Set(), I = L.map(
|
265
|
+
(k) => k.endsWith(" *") ? k.slice(0, -2) : k
|
266
|
+
);
|
267
|
+
for (const k of I)
|
268
|
+
for (const R of ae)
|
269
|
+
if (!O.has(R) && k !== R && k.startsWith(R + " ")) {
|
270
|
+
O.add(R);
|
271
|
+
for (const q of ae)
|
272
|
+
q.startsWith(R + " ") && O.add(q);
|
273
|
+
}
|
274
|
+
return O;
|
275
|
+
}
|
276
|
+
function ke(L, O, I) {
|
277
|
+
let k = [];
|
232
278
|
try {
|
233
|
-
const t =
|
234
|
-
|
279
|
+
const t = de(L, I?.platform);
|
280
|
+
k = _e(t);
|
235
281
|
} catch (t) {
|
236
|
-
|
282
|
+
pe.warn("Failed to parse command", { cmd: L }, t), k = [L];
|
237
283
|
}
|
238
|
-
const
|
239
|
-
if (
|
284
|
+
const R = I?.config?.["commands.allowlist"] || [], q = I?.config?.["commands.strict"] ?? !1;
|
285
|
+
if (R.includes("*"))
|
240
286
|
return {
|
241
287
|
requiresConfirmation: !1,
|
242
|
-
parts:
|
288
|
+
parts: k.map((t) => ({ command: t, requiresConfirmation: !1 }))
|
243
289
|
};
|
244
|
-
const
|
290
|
+
const N = k.map((t) => {
|
245
291
|
if (typeof t == "string")
|
246
292
|
return { command: t, requiresConfirmation: !0 };
|
247
|
-
const l = Ee(t,
|
293
|
+
const l = Ee(t, q), d = t.arguments.some((a) => typeof a != "string");
|
248
294
|
function _(a) {
|
249
295
|
return a === ne ? "<dynamic>" : a;
|
250
296
|
}
|
251
297
|
const n = `${_(t.program)} ${t.arguments.map(_).join(" ")}`;
|
252
298
|
if (!d) {
|
253
|
-
for (const a of
|
299
|
+
for (const a of R)
|
254
300
|
if (n === a)
|
255
301
|
return { command: t, requiresConfirmation: !1 };
|
256
302
|
}
|
257
|
-
if (
|
258
|
-
return re(t,
|
259
|
-
|
303
|
+
if (Ae(n))
|
304
|
+
return re(t, O, l) ? { command: t, requiresConfirmation: !0 } : { command: t, requiresConfirmation: !1 };
|
305
|
+
let c;
|
306
|
+
if (q)
|
307
|
+
c = R;
|
308
|
+
else {
|
309
|
+
const a = Te(R);
|
310
|
+
c = [...ae.filter(
|
311
|
+
(u) => !a.has(u)
|
312
|
+
), ...R];
|
313
|
+
}
|
260
314
|
for (let a of c) {
|
261
315
|
a.endsWith(" *") && (a = a.slice(0, -2));
|
262
316
|
const h = " * ";
|
263
317
|
if (a.includes(h) && !a.startsWith(h)) {
|
264
318
|
const u = a.split(h).map((r) => r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
265
319
|
if (new RegExp(`^${u.join(" .* ")}(\\s.*)?$`).test(n))
|
266
|
-
return re(t,
|
320
|
+
return re(t, O, l) ? { command: t, requiresConfirmation: !0 } : { command: t, requiresConfirmation: !1 };
|
267
321
|
} else if (n === a || n.startsWith(a + " "))
|
268
|
-
return re(t,
|
322
|
+
return re(t, O, l) ? { command: t, requiresConfirmation: !0 } : { command: t, requiresConfirmation: !1 };
|
269
323
|
}
|
270
324
|
return { command: t, requiresConfirmation: !0 };
|
271
325
|
});
|
272
|
-
return { requiresConfirmation:
|
326
|
+
return { requiresConfirmation: N.some((t) => t.requiresConfirmation), parts: N };
|
273
327
|
}
|
274
|
-
var ie = {},
|
275
|
-
function
|
276
|
-
return
|
328
|
+
var ie = {}, he;
|
329
|
+
function Le() {
|
330
|
+
return he || (he = 1, function(L) {
|
277
331
|
(() => {
|
278
|
-
var
|
332
|
+
var O = { 349: (w, t, l) => {
|
279
333
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.CircularList = void 0;
|
280
334
|
const d = l(460), _ = l(844);
|
281
335
|
class n extends _.Disposable {
|
@@ -359,7 +413,7 @@ function ke() {
|
|
359
413
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.CoreTerminal = void 0;
|
360
414
|
const d = l(844), _ = l(585), n = l(348), c = l(866), a = l(744), h = l(302), u = l(83), e = l(460), r = l(753), i = l(480), s = l(994), f = l(282), p = l(435), S = l(981), y = l(660);
|
361
415
|
let C = !1;
|
362
|
-
class
|
416
|
+
class T extends d.Disposable {
|
363
417
|
get onScroll() {
|
364
418
|
return this._onScrollApi || (this._onScrollApi = this.register(new e.EventEmitter()), this._onScroll.event((E) => {
|
365
419
|
this._onScrollApi?.fire(E.position);
|
@@ -385,7 +439,7 @@ function ke() {
|
|
385
439
|
this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: 0 }), this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);
|
386
440
|
})), this.register(this._inputHandler.onScroll((B) => {
|
387
441
|
this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: 0 }), this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);
|
388
|
-
})), this._writeBuffer = this.register(new S.WriteBuffer((B,
|
442
|
+
})), this._writeBuffer = this.register(new S.WriteBuffer((B, D) => this._inputHandler.parse(B, D))), this.register((0, e.forwardEvent)(this._writeBuffer.onWriteParsed, this._onWriteParsed));
|
389
443
|
}
|
390
444
|
write(E, B) {
|
391
445
|
this._writeBuffer.write(E, B);
|
@@ -402,8 +456,8 @@ function ke() {
|
|
402
456
|
scroll(E, B = !1) {
|
403
457
|
this._bufferService.scroll(E, B);
|
404
458
|
}
|
405
|
-
scrollLines(E, B,
|
406
|
-
this._bufferService.scrollLines(E, B,
|
459
|
+
scrollLines(E, B, D) {
|
460
|
+
this._bufferService.scrollLines(E, B, D);
|
407
461
|
}
|
408
462
|
scrollPages(E) {
|
409
463
|
this.scrollLines(E * (this.rows - 1));
|
@@ -450,7 +504,7 @@ function ke() {
|
|
450
504
|
}
|
451
505
|
}
|
452
506
|
}
|
453
|
-
t.CoreTerminal =
|
507
|
+
t.CoreTerminal = T;
|
454
508
|
}, 460: (w, t) => {
|
455
509
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.runAndSubscribe = t.forwardEvent = t.EventEmitter = void 0, t.EventEmitter = class {
|
456
510
|
constructor() {
|
@@ -481,17 +535,17 @@ function ke() {
|
|
481
535
|
};
|
482
536
|
}, 435: function(w, t, l) {
|
483
537
|
var d = this && this.__decorate || function(H, o, m, g) {
|
484
|
-
var b, A = arguments.length,
|
485
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
486
|
-
else for (var
|
487
|
-
return A > 3 &&
|
538
|
+
var b, A = arguments.length, P = A < 3 ? o : g === null ? g = Object.getOwnPropertyDescriptor(o, m) : g;
|
539
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") P = Reflect.decorate(H, o, m, g);
|
540
|
+
else for (var W = H.length - 1; W >= 0; W--) (b = H[W]) && (P = (A < 3 ? b(P) : A > 3 ? b(o, m, P) : b(o, m)) || P);
|
541
|
+
return A > 3 && P && Object.defineProperty(o, m, P), P;
|
488
542
|
}, _ = this && this.__param || function(H, o) {
|
489
543
|
return function(m, g) {
|
490
544
|
o(m, g, H);
|
491
545
|
};
|
492
546
|
};
|
493
547
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.InputHandler = t.WindowsOptionsReportType = void 0;
|
494
|
-
const n = l(584), c = l(116), a = l(15), h = l(844), u = l(482), e = l(437), r = l(460), i = l(643), s = l(511), f = l(734), p = l(585), S = l(480), y = l(242), C = l(351),
|
548
|
+
const n = l(584), c = l(116), a = l(15), h = l(844), u = l(482), e = l(437), r = l(460), i = l(643), s = l(511), f = l(734), p = l(585), S = l(480), y = l(242), C = l(351), T = l(941), $ = { "(": 0, ")": 1, "*": 2, "+": 3, "-": 1, ".": 2 }, E = 131072;
|
495
549
|
function B(H, o) {
|
496
550
|
if (H > 24) return o.setWinLines || !1;
|
497
551
|
switch (H) {
|
@@ -542,29 +596,29 @@ function ke() {
|
|
542
596
|
}
|
543
597
|
return !1;
|
544
598
|
}
|
545
|
-
var
|
599
|
+
var D;
|
546
600
|
(function(H) {
|
547
601
|
H[H.GET_WIN_SIZE_PIXELS = 0] = "GET_WIN_SIZE_PIXELS", H[H.GET_CELL_SIZE_PIXELS = 1] = "GET_CELL_SIZE_PIXELS";
|
548
|
-
})(
|
602
|
+
})(D || (t.WindowsOptionsReportType = D = {}));
|
549
603
|
let G = 0;
|
550
604
|
class V extends h.Disposable {
|
551
605
|
getAttrData() {
|
552
606
|
return this._curAttrData;
|
553
607
|
}
|
554
|
-
constructor(o, m, g, b, A,
|
555
|
-
super(), this._bufferService = o, this._charsetService = m, this._coreService = g, this._logService = b, this._optionsService = A, this._oscLinkService =
|
556
|
-
this._logService.debug("Unknown CSI code: ", { identifier: this._parser.identToString(v), params:
|
608
|
+
constructor(o, m, g, b, A, P, W, j, z = new a.EscapeSequenceParser()) {
|
609
|
+
super(), this._bufferService = o, this._charsetService = m, this._coreService = g, this._logService = b, this._optionsService = A, this._oscLinkService = P, this._coreMouseService = W, this._unicodeService = j, this._parser = z, this._parseBuffer = new Uint32Array(4096), this._stringDecoder = new u.StringToUtf32(), this._utf8Decoder = new u.Utf8ToUtf32(), this._workCell = new s.CellData(), this._windowTitle = "", this._iconName = "", this._windowTitleStack = [], this._iconNameStack = [], this._curAttrData = e.DEFAULT_ATTR_DATA.clone(), this._eraseAttrDataInternal = e.DEFAULT_ATTR_DATA.clone(), this._onRequestBell = this.register(new r.EventEmitter()), this.onRequestBell = this._onRequestBell.event, this._onRequestRefreshRows = this.register(new r.EventEmitter()), this.onRequestRefreshRows = this._onRequestRefreshRows.event, this._onRequestReset = this.register(new r.EventEmitter()), this.onRequestReset = this._onRequestReset.event, this._onRequestSendFocus = this.register(new r.EventEmitter()), this.onRequestSendFocus = this._onRequestSendFocus.event, this._onRequestSyncScrollBar = this.register(new r.EventEmitter()), this.onRequestSyncScrollBar = this._onRequestSyncScrollBar.event, this._onRequestWindowsOptionsReport = this.register(new r.EventEmitter()), this.onRequestWindowsOptionsReport = this._onRequestWindowsOptionsReport.event, this._onA11yChar = this.register(new r.EventEmitter()), this.onA11yChar = this._onA11yChar.event, this._onA11yTab = this.register(new r.EventEmitter()), this.onA11yTab = this._onA11yTab.event, this._onCursorMove = this.register(new r.EventEmitter()), this.onCursorMove = this._onCursorMove.event, this._onLineFeed = this.register(new r.EventEmitter()), this.onLineFeed = this._onLineFeed.event, this._onScroll = this.register(new r.EventEmitter()), this.onScroll = this._onScroll.event, this._onTitleChange = this.register(new r.EventEmitter()), this.onTitleChange = this._onTitleChange.event, this._onColor = this.register(new r.EventEmitter()), this.onColor = this._onColor.event, this._parseStack = { paused: !1, cursorStartX: 0, cursorStartY: 0, decodedLength: 0, position: 0 }, this._specialColors = [256, 257, 258], this.register(this._parser), this._dirtyRowTracker = new U(this._bufferService), this._activeBuffer = this._bufferService.buffer, this.register(this._bufferService.buffers.onBufferActivate((v) => this._activeBuffer = v.activeBuffer)), this._parser.setCsiHandlerFallback((v, F) => {
|
610
|
+
this._logService.debug("Unknown CSI code: ", { identifier: this._parser.identToString(v), params: F.toArray() });
|
557
611
|
}), this._parser.setEscHandlerFallback((v) => {
|
558
612
|
this._logService.debug("Unknown ESC code: ", { identifier: this._parser.identToString(v) });
|
559
613
|
}), this._parser.setExecuteHandlerFallback((v) => {
|
560
614
|
this._logService.debug("Unknown EXECUTE code: ", { code: v });
|
561
|
-
}), this._parser.setOscHandlerFallback((v,
|
562
|
-
this._logService.debug("Unknown OSC code: ", { identifier: v, action:
|
563
|
-
}), this._parser.setDcsHandlerFallback((v,
|
564
|
-
|
565
|
-
}), this._parser.setPrintHandler((v,
|
615
|
+
}), this._parser.setOscHandlerFallback((v, F, x) => {
|
616
|
+
this._logService.debug("Unknown OSC code: ", { identifier: v, action: F, data: x });
|
617
|
+
}), this._parser.setDcsHandlerFallback((v, F, x) => {
|
618
|
+
F === "HOOK" && (x = x.toArray()), this._logService.debug("Unknown DCS code: ", { identifier: this._parser.identToString(v), action: F, payload: x });
|
619
|
+
}), this._parser.setPrintHandler((v, F, x) => this.print(v, F, x)), this._parser.registerCsiHandler({ final: "@" }, (v) => this.insertChars(v)), this._parser.registerCsiHandler({ intermediates: " ", final: "@" }, (v) => this.scrollLeft(v)), this._parser.registerCsiHandler({ final: "A" }, (v) => this.cursorUp(v)), this._parser.registerCsiHandler({ intermediates: " ", final: "A" }, (v) => this.scrollRight(v)), this._parser.registerCsiHandler({ final: "B" }, (v) => this.cursorDown(v)), this._parser.registerCsiHandler({ final: "C" }, (v) => this.cursorForward(v)), this._parser.registerCsiHandler({ final: "D" }, (v) => this.cursorBackward(v)), this._parser.registerCsiHandler({ final: "E" }, (v) => this.cursorNextLine(v)), this._parser.registerCsiHandler({ final: "F" }, (v) => this.cursorPrecedingLine(v)), this._parser.registerCsiHandler({ final: "G" }, (v) => this.cursorCharAbsolute(v)), this._parser.registerCsiHandler({ final: "H" }, (v) => this.cursorPosition(v)), this._parser.registerCsiHandler({ final: "I" }, (v) => this.cursorForwardTab(v)), this._parser.registerCsiHandler({ final: "J" }, (v) => this.eraseInDisplay(v, !1)), this._parser.registerCsiHandler({ prefix: "?", final: "J" }, (v) => this.eraseInDisplay(v, !0)), this._parser.registerCsiHandler({ final: "K" }, (v) => this.eraseInLine(v, !1)), this._parser.registerCsiHandler({ prefix: "?", final: "K" }, (v) => this.eraseInLine(v, !0)), this._parser.registerCsiHandler({ final: "L" }, (v) => this.insertLines(v)), this._parser.registerCsiHandler({ final: "M" }, (v) => this.deleteLines(v)), this._parser.registerCsiHandler({ final: "P" }, (v) => this.deleteChars(v)), this._parser.registerCsiHandler({ final: "S" }, (v) => this.scrollUp(v)), this._parser.registerCsiHandler({ final: "T" }, (v) => this.scrollDown(v)), this._parser.registerCsiHandler({ final: "X" }, (v) => this.eraseChars(v)), this._parser.registerCsiHandler({ final: "Z" }, (v) => this.cursorBackwardTab(v)), this._parser.registerCsiHandler({ final: "`" }, (v) => this.charPosAbsolute(v)), this._parser.registerCsiHandler({ final: "a" }, (v) => this.hPositionRelative(v)), this._parser.registerCsiHandler({ final: "b" }, (v) => this.repeatPrecedingCharacter(v)), this._parser.registerCsiHandler({ final: "c" }, (v) => this.sendDeviceAttributesPrimary(v)), this._parser.registerCsiHandler({ prefix: ">", final: "c" }, (v) => this.sendDeviceAttributesSecondary(v)), this._parser.registerCsiHandler({ final: "d" }, (v) => this.linePosAbsolute(v)), this._parser.registerCsiHandler({ final: "e" }, (v) => this.vPositionRelative(v)), this._parser.registerCsiHandler({ final: "f" }, (v) => this.hVPosition(v)), this._parser.registerCsiHandler({ final: "g" }, (v) => this.tabClear(v)), this._parser.registerCsiHandler({ final: "h" }, (v) => this.setMode(v)), this._parser.registerCsiHandler({ prefix: "?", final: "h" }, (v) => this.setModePrivate(v)), this._parser.registerCsiHandler({ final: "l" }, (v) => this.resetMode(v)), this._parser.registerCsiHandler({ prefix: "?", final: "l" }, (v) => this.resetModePrivate(v)), this._parser.registerCsiHandler({ final: "m" }, (v) => this.charAttributes(v)), this._parser.registerCsiHandler({ final: "n" }, (v) => this.deviceStatus(v)), this._parser.registerCsiHandler({ prefix: "?", final: "n" }, (v) => this.deviceStatusPrivate(v)), this._parser.registerCsiHandler({ intermediates: "!", final: "p" }, (v) => this.softReset(v)), this._parser.registerCsiHandler({ intermediates: " ", final: "q" }, (v) => this.setCursorStyle(v)), this._parser.registerCsiHandler({ final: "r" }, (v) => this.setScrollRegion(v)), this._parser.registerCsiHandler({ final: "s" }, (v) => this.saveCursor(v)), this._parser.registerCsiHandler({ final: "t" }, (v) => this.windowOptions(v)), this._parser.registerCsiHandler({ final: "u" }, (v) => this.restoreCursor(v)), this._parser.registerCsiHandler({ intermediates: "'", final: "}" }, (v) => this.insertColumns(v)), this._parser.registerCsiHandler({ intermediates: "'", final: "~" }, (v) => this.deleteColumns(v)), this._parser.registerCsiHandler({ intermediates: '"', final: "q" }, (v) => this.selectProtected(v)), this._parser.registerCsiHandler({ intermediates: "$", final: "p" }, (v) => this.requestMode(v, !0)), this._parser.registerCsiHandler({ prefix: "?", intermediates: "$", final: "p" }, (v) => this.requestMode(v, !1)), this._parser.setExecuteHandler(n.C0.BEL, () => this.bell()), this._parser.setExecuteHandler(n.C0.LF, () => this.lineFeed()), this._parser.setExecuteHandler(n.C0.VT, () => this.lineFeed()), this._parser.setExecuteHandler(n.C0.FF, () => this.lineFeed()), this._parser.setExecuteHandler(n.C0.CR, () => this.carriageReturn()), this._parser.setExecuteHandler(n.C0.BS, () => this.backspace()), this._parser.setExecuteHandler(n.C0.HT, () => this.tab()), this._parser.setExecuteHandler(n.C0.SO, () => this.shiftOut()), this._parser.setExecuteHandler(n.C0.SI, () => this.shiftIn()), this._parser.setExecuteHandler(n.C1.IND, () => this.index()), this._parser.setExecuteHandler(n.C1.NEL, () => this.nextLine()), this._parser.setExecuteHandler(n.C1.HTS, () => this.tabSet()), this._parser.registerOscHandler(0, new y.OscHandler((v) => (this.setTitle(v), this.setIconName(v), !0))), this._parser.registerOscHandler(1, new y.OscHandler((v) => this.setIconName(v))), this._parser.registerOscHandler(2, new y.OscHandler((v) => this.setTitle(v))), this._parser.registerOscHandler(4, new y.OscHandler((v) => this.setOrReportIndexedColor(v))), this._parser.registerOscHandler(8, new y.OscHandler((v) => this.setHyperlink(v))), this._parser.registerOscHandler(10, new y.OscHandler((v) => this.setOrReportFgColor(v))), this._parser.registerOscHandler(11, new y.OscHandler((v) => this.setOrReportBgColor(v))), this._parser.registerOscHandler(12, new y.OscHandler((v) => this.setOrReportCursorColor(v))), this._parser.registerOscHandler(104, new y.OscHandler((v) => this.restoreIndexedColor(v))), this._parser.registerOscHandler(110, new y.OscHandler((v) => this.restoreFgColor(v))), this._parser.registerOscHandler(111, new y.OscHandler((v) => this.restoreBgColor(v))), this._parser.registerOscHandler(112, new y.OscHandler((v) => this.restoreCursorColor(v))), this._parser.registerEscHandler({ final: "7" }, () => this.saveCursor()), this._parser.registerEscHandler({ final: "8" }, () => this.restoreCursor()), this._parser.registerEscHandler({ final: "D" }, () => this.index()), this._parser.registerEscHandler({ final: "E" }, () => this.nextLine()), this._parser.registerEscHandler({ final: "H" }, () => this.tabSet()), this._parser.registerEscHandler({ final: "M" }, () => this.reverseIndex()), this._parser.registerEscHandler({ final: "=" }, () => this.keypadApplicationMode()), this._parser.registerEscHandler({ final: ">" }, () => this.keypadNumericMode()), this._parser.registerEscHandler({ final: "c" }, () => this.fullReset()), this._parser.registerEscHandler({ final: "n" }, () => this.setgLevel(2)), this._parser.registerEscHandler({ final: "o" }, () => this.setgLevel(3)), this._parser.registerEscHandler({ final: "|" }, () => this.setgLevel(3)), this._parser.registerEscHandler({ final: "}" }, () => this.setgLevel(2)), this._parser.registerEscHandler({ final: "~" }, () => this.setgLevel(1)), this._parser.registerEscHandler({ intermediates: "%", final: "@" }, () => this.selectDefaultCharset()), this._parser.registerEscHandler({ intermediates: "%", final: "G" }, () => this.selectDefaultCharset());
|
566
620
|
for (const v in c.CHARSETS) this._parser.registerEscHandler({ intermediates: "(", final: v }, () => this.selectCharset("(" + v)), this._parser.registerEscHandler({ intermediates: ")", final: v }, () => this.selectCharset(")" + v)), this._parser.registerEscHandler({ intermediates: "*", final: v }, () => this.selectCharset("*" + v)), this._parser.registerEscHandler({ intermediates: "+", final: v }, () => this.selectCharset("+" + v)), this._parser.registerEscHandler({ intermediates: "-", final: v }, () => this.selectCharset("-" + v)), this._parser.registerEscHandler({ intermediates: ".", final: v }, () => this.selectCharset("." + v)), this._parser.registerEscHandler({ intermediates: "/", final: v }, () => this.selectCharset("/" + v));
|
567
|
-
this._parser.registerEscHandler({ intermediates: "#", final: "8" }, () => this.screenAlignmentPattern()), this._parser.setErrorHandler((v) => (this._logService.error("Parsing error: ", v), v)), this._parser.registerDcsHandler({ intermediates: "$", final: "q" }, new C.DcsHandler((v,
|
621
|
+
this._parser.registerEscHandler({ intermediates: "#", final: "8" }, () => this.screenAlignmentPattern()), this._parser.setErrorHandler((v) => (this._logService.error("Parsing error: ", v), v)), this._parser.registerDcsHandler({ intermediates: "$", final: "q" }, new C.DcsHandler((v, F) => this.requestStatusString(v, F)));
|
568
622
|
}
|
569
623
|
_preserveStack(o, m, g, b) {
|
570
624
|
this._parseStack.paused = !0, this._parseStack.cursorStartX = o, this._parseStack.cursorStartY = m, this._parseStack.decodedLength = g, this._parseStack.position = b;
|
@@ -579,52 +633,52 @@ function ke() {
|
|
579
633
|
return this._curAttrData.extended.urlId;
|
580
634
|
}
|
581
635
|
parse(o, m) {
|
582
|
-
let g, b = this._activeBuffer.x, A = this._activeBuffer.y,
|
583
|
-
const
|
584
|
-
if (
|
636
|
+
let g, b = this._activeBuffer.x, A = this._activeBuffer.y, P = 0;
|
637
|
+
const W = this._parseStack.paused;
|
638
|
+
if (W) {
|
585
639
|
if (g = this._parser.parse(this._parseBuffer, this._parseStack.decodedLength, m)) return this._logSlowResolvingAsync(g), g;
|
586
|
-
b = this._parseStack.cursorStartX, A = this._parseStack.cursorStartY, this._parseStack.paused = !1, o.length > E && (
|
640
|
+
b = this._parseStack.cursorStartX, A = this._parseStack.cursorStartY, this._parseStack.paused = !1, o.length > E && (P = this._parseStack.position + E);
|
587
641
|
}
|
588
|
-
if (this._logService.logLevel <= p.LogLevelEnum.DEBUG && this._logService.debug("parsing data" + (typeof o == "string" ? ` "${o}"` : ` "${Array.prototype.map.call(o, (v) => String.fromCharCode(v)).join("")}"`), typeof o == "string" ? o.split("").map((v) => v.charCodeAt(0)) : o), this._parseBuffer.length < o.length && this._parseBuffer.length < E && (this._parseBuffer = new Uint32Array(Math.min(o.length, E))),
|
589
|
-
const
|
590
|
-
if (g = this._parser.parse(this._parseBuffer,
|
642
|
+
if (this._logService.logLevel <= p.LogLevelEnum.DEBUG && this._logService.debug("parsing data" + (typeof o == "string" ? ` "${o}"` : ` "${Array.prototype.map.call(o, (v) => String.fromCharCode(v)).join("")}"`), typeof o == "string" ? o.split("").map((v) => v.charCodeAt(0)) : o), this._parseBuffer.length < o.length && this._parseBuffer.length < E && (this._parseBuffer = new Uint32Array(Math.min(o.length, E))), W || this._dirtyRowTracker.clearRange(), o.length > E) for (let v = P; v < o.length; v += E) {
|
643
|
+
const F = v + E < o.length ? v + E : o.length, x = typeof o == "string" ? this._stringDecoder.decode(o.substring(v, F), this._parseBuffer) : this._utf8Decoder.decode(o.subarray(v, F), this._parseBuffer);
|
644
|
+
if (g = this._parser.parse(this._parseBuffer, x)) return this._preserveStack(b, A, x, v), this._logSlowResolvingAsync(g), g;
|
591
645
|
}
|
592
|
-
else if (!
|
646
|
+
else if (!W) {
|
593
647
|
const v = typeof o == "string" ? this._stringDecoder.decode(o, this._parseBuffer) : this._utf8Decoder.decode(o, this._parseBuffer);
|
594
648
|
if (g = this._parser.parse(this._parseBuffer, v)) return this._preserveStack(b, A, v, 0), this._logSlowResolvingAsync(g), g;
|
595
649
|
}
|
596
650
|
this._activeBuffer.x === b && this._activeBuffer.y === A || this._onCursorMove.fire();
|
597
|
-
const
|
598
|
-
z < this._bufferService.rows && this._onRequestRefreshRows.fire(Math.min(z, this._bufferService.rows - 1), Math.min(
|
651
|
+
const j = this._dirtyRowTracker.end + (this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp), z = this._dirtyRowTracker.start + (this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp);
|
652
|
+
z < this._bufferService.rows && this._onRequestRefreshRows.fire(Math.min(z, this._bufferService.rows - 1), Math.min(j, this._bufferService.rows - 1));
|
599
653
|
}
|
600
654
|
print(o, m, g) {
|
601
655
|
let b, A;
|
602
|
-
const
|
603
|
-
let
|
604
|
-
this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._activeBuffer.x && g - m > 0 &&
|
605
|
-
let
|
656
|
+
const P = this._charsetService.charset, W = this._optionsService.rawOptions.screenReaderMode, j = this._bufferService.cols, z = this._coreService.decPrivateModes.wraparound, v = this._coreService.modes.insertMode, F = this._curAttrData;
|
657
|
+
let x = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
|
658
|
+
this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._activeBuffer.x && g - m > 0 && x.getWidth(this._activeBuffer.x - 1) === 2 && x.setCellFromCodepoint(this._activeBuffer.x - 1, 0, 1, F);
|
659
|
+
let M = this._parser.precedingJoinState;
|
606
660
|
for (let J = m; J < g; ++J) {
|
607
|
-
if (b = o[J], b < 127 &&
|
608
|
-
const Y =
|
661
|
+
if (b = o[J], b < 127 && P) {
|
662
|
+
const Y = P[String.fromCharCode(b)];
|
609
663
|
Y && (b = Y.charCodeAt(0));
|
610
664
|
}
|
611
|
-
const Q = this._unicodeService.charProperties(b,
|
665
|
+
const Q = this._unicodeService.charProperties(b, M);
|
612
666
|
A = S.UnicodeService.extractWidth(Q);
|
613
|
-
const te = S.UnicodeService.extractShouldJoin(Q), K = te ? S.UnicodeService.extractWidth(
|
614
|
-
if (
|
667
|
+
const te = S.UnicodeService.extractShouldJoin(Q), K = te ? S.UnicodeService.extractWidth(M) : 0;
|
668
|
+
if (M = Q, W && this._onA11yChar.fire((0, u.stringFromCodePoint)(b)), this._getCurrentLinkId() && this._oscLinkService.addLineToLink(this._getCurrentLinkId(), this._activeBuffer.ybase + this._activeBuffer.y), this._activeBuffer.x + A - K > j) {
|
615
669
|
if (z) {
|
616
|
-
const Y =
|
670
|
+
const Y = x;
|
617
671
|
let Z = this._activeBuffer.x - K;
|
618
|
-
for (this._activeBuffer.x = K, this._activeBuffer.y++, this._activeBuffer.y === this._activeBuffer.scrollBottom + 1 ? (this._activeBuffer.y--, this._bufferService.scroll(this._eraseAttrData(), !0)) : (this._activeBuffer.y >= this._bufferService.rows && (this._activeBuffer.y = this._bufferService.rows - 1), this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).isWrapped = !0),
|
619
|
-
} else if (this._activeBuffer.x =
|
672
|
+
for (this._activeBuffer.x = K, this._activeBuffer.y++, this._activeBuffer.y === this._activeBuffer.scrollBottom + 1 ? (this._activeBuffer.y--, this._bufferService.scroll(this._eraseAttrData(), !0)) : (this._activeBuffer.y >= this._bufferService.rows && (this._activeBuffer.y = this._bufferService.rows - 1), this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).isWrapped = !0), x = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y), K > 0 && x instanceof e.BufferLine && x.copyCellsFrom(Y, Z, 0, K, !1); Z < j; ) Y.setCellFromCodepoint(Z++, 0, 1, F);
|
673
|
+
} else if (this._activeBuffer.x = j - 1, A === 2) continue;
|
620
674
|
}
|
621
675
|
if (te && this._activeBuffer.x) {
|
622
|
-
const Y =
|
623
|
-
|
624
|
-
for (let Z = A - K; --Z >= 0; )
|
625
|
-
} else if (v && (
|
676
|
+
const Y = x.getWidth(this._activeBuffer.x - 1) ? 1 : 2;
|
677
|
+
x.addCodepointToCell(this._activeBuffer.x - Y, b, A);
|
678
|
+
for (let Z = A - K; --Z >= 0; ) x.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, F);
|
679
|
+
} else if (v && (x.insertCells(this._activeBuffer.x, A - K, this._activeBuffer.getNullCell(F)), x.getWidth(j - 1) === 2 && x.setCellFromCodepoint(j - 1, i.NULL_CELL_CODE, i.NULL_CELL_WIDTH, F)), x.setCellFromCodepoint(this._activeBuffer.x++, b, A, F), A > 0) for (; --A; ) x.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, F);
|
626
680
|
}
|
627
|
-
this._parser.precedingJoinState =
|
681
|
+
this._parser.precedingJoinState = M, this._activeBuffer.x < j && g - m > 0 && x.getWidth(this._activeBuffer.x) === 0 && !x.hasContent(this._activeBuffer.x) && x.setCellFromCodepoint(this._activeBuffer.x, 0, 1, F), this._dirtyRowTracker.markDirty(this._activeBuffer.y);
|
628
682
|
}
|
629
683
|
registerCsiHandler(o, m) {
|
630
684
|
return o.final !== "t" || o.prefix || o.intermediates ? this._parser.registerCsiHandler(o, m) : this._parser.registerCsiHandler(o, (g) => !B(g.params[0], this._optionsService.rawOptions.windowOptions) || m(g));
|
@@ -739,8 +793,8 @@ function ke() {
|
|
739
793
|
return m === 1 && (this._curAttrData.bg |= 536870912), m !== 2 && m !== 0 || (this._curAttrData.bg &= -536870913), !0;
|
740
794
|
}
|
741
795
|
_eraseInBufferLine(o, m, g, b = !1, A = !1) {
|
742
|
-
const
|
743
|
-
|
796
|
+
const P = this._activeBuffer.lines.get(this._activeBuffer.ybase + o);
|
797
|
+
P.replaceCells(m, g, this._activeBuffer.getNullCell(this._eraseAttrData()), A), b && (P.isWrapped = !1);
|
744
798
|
}
|
745
799
|
_resetBufferLine(o, m = !1) {
|
746
800
|
const g = this._activeBuffer.lines.get(this._activeBuffer.ybase + o);
|
@@ -861,15 +915,15 @@ function ke() {
|
|
861
915
|
repeatPrecedingCharacter(o) {
|
862
916
|
const m = this._parser.precedingJoinState;
|
863
917
|
if (!m) return !0;
|
864
|
-
const g = o.params[0] || 1, b = S.UnicodeService.extractWidth(m), A = this._activeBuffer.x - b,
|
865
|
-
let
|
866
|
-
for (let v = 0; v <
|
867
|
-
const
|
868
|
-
|
918
|
+
const g = o.params[0] || 1, b = S.UnicodeService.extractWidth(m), A = this._activeBuffer.x - b, P = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).getString(A), W = new Uint32Array(P.length * g);
|
919
|
+
let j = 0;
|
920
|
+
for (let v = 0; v < P.length; ) {
|
921
|
+
const F = P.codePointAt(v) || 0;
|
922
|
+
W[j++] = F, v += F > 65535 ? 2 : 1;
|
869
923
|
}
|
870
|
-
let z =
|
871
|
-
for (let v = 1; v < g; ++v)
|
872
|
-
return this.print(
|
924
|
+
let z = j;
|
925
|
+
for (let v = 1; v < g; ++v) W.copyWithin(z, 0, j), z += j;
|
926
|
+
return this.print(W, 0, z), !0;
|
873
927
|
}
|
874
928
|
sendDeviceAttributesPrimary(o) {
|
875
929
|
return o.params[0] > 0 || (this._is("xterm") || this._is("rxvt-unicode") || this._is("screen") ? this._coreService.triggerDataEvent(n.C0.ESC + "[?1;2c") : this._is("linux") && this._coreService.triggerDataEvent(n.C0.ESC + "[?6c")), !0;
|
@@ -1029,8 +1083,8 @@ function ke() {
|
|
1029
1083
|
return !0;
|
1030
1084
|
}
|
1031
1085
|
requestMode(o, m) {
|
1032
|
-
const g = this._coreService.decPrivateModes, { activeProtocol: b, activeEncoding: A } = this._coreMouseService,
|
1033
|
-
return J =
|
1086
|
+
const g = this._coreService.decPrivateModes, { activeProtocol: b, activeEncoding: A } = this._coreMouseService, P = this._coreService, { buffers: W, cols: j } = this._bufferService, { active: z, alt: v } = W, F = this._optionsService.rawOptions, x = (te) => te ? 1 : 2, M = o.params[0];
|
1087
|
+
return J = M, Q = m ? M === 2 ? 4 : M === 4 ? x(P.modes.insertMode) : M === 12 ? 3 : M === 20 ? x(F.convertEol) : 0 : M === 1 ? x(g.applicationCursorKeys) : M === 3 ? F.windowOptions.setWinLines ? j === 80 ? 2 : j === 132 ? 1 : 0 : 0 : M === 6 ? x(g.origin) : M === 7 ? x(g.wraparound) : M === 8 ? 3 : M === 9 ? x(b === "X10") : M === 12 ? x(F.cursorBlink) : M === 25 ? x(!P.isCursorHidden) : M === 45 ? x(g.reverseWraparound) : M === 66 ? x(g.applicationKeypad) : M === 67 ? 4 : M === 1e3 ? x(b === "VT200") : M === 1002 ? x(b === "DRAG") : M === 1003 ? x(b === "ANY") : M === 1004 ? x(g.sendFocus) : M === 1005 ? 4 : M === 1006 ? x(A === "SGR") : M === 1015 ? 4 : M === 1016 ? x(A === "SGR_PIXELS") : M === 1048 ? 1 : M === 47 || M === 1047 || M === 1049 ? x(z === v) : M === 2004 ? x(g.bracketedPasteMode) : 0, P.triggerDataEvent(`${n.C0.ESC}[${m ? "" : "?"}${J};${Q}$y`), !0;
|
1034
1088
|
var J, Q;
|
1035
1089
|
}
|
1036
1090
|
_updateAttrColor(o, m, g, b, A) {
|
@@ -1038,20 +1092,20 @@ function ke() {
|
|
1038
1092
|
}
|
1039
1093
|
_extractColor(o, m, g) {
|
1040
1094
|
const b = [0, 0, -1, 0, 0, 0];
|
1041
|
-
let A = 0,
|
1095
|
+
let A = 0, P = 0;
|
1042
1096
|
do {
|
1043
|
-
if (b[
|
1044
|
-
const
|
1045
|
-
let
|
1097
|
+
if (b[P + A] = o.params[m + P], o.hasSubParams(m + P)) {
|
1098
|
+
const W = o.getSubParams(m + P);
|
1099
|
+
let j = 0;
|
1046
1100
|
do
|
1047
|
-
b[1] === 5 && (A = 1), b[
|
1048
|
-
while (++
|
1101
|
+
b[1] === 5 && (A = 1), b[P + j + 1 + A] = W[j];
|
1102
|
+
while (++j < W.length && j + P + 1 + A < b.length);
|
1049
1103
|
break;
|
1050
1104
|
}
|
1051
|
-
if (b[1] === 5 &&
|
1105
|
+
if (b[1] === 5 && P + A >= 2 || b[1] === 2 && P + A >= 5) break;
|
1052
1106
|
b[1] && (A = 1);
|
1053
|
-
} while (++
|
1054
|
-
for (let
|
1107
|
+
} while (++P + m < o.length && P + A < b.length);
|
1108
|
+
for (let W = 2; W < b.length; ++W) b[W] === -1 && (b[W] = 0);
|
1055
1109
|
switch (b[0]) {
|
1056
1110
|
case 38:
|
1057
1111
|
g.fg = this._updateAttrColor(g.fg, b[1], b[3], b[4], b[5]);
|
@@ -1062,7 +1116,7 @@ function ke() {
|
|
1062
1116
|
case 58:
|
1063
1117
|
g.extended = g.extended.clone(), g.extended.underlineColor = this._updateAttrColor(g.extended.underlineColor, b[1], b[3], b[4], b[5]);
|
1064
1118
|
}
|
1065
|
-
return
|
1119
|
+
return P;
|
1066
1120
|
}
|
1067
1121
|
_processUnderline(o, m) {
|
1068
1122
|
m.extended = m.extended.clone(), (!~o || o > 5) && (o = 1), m.extended.underlineStyle = o, m.fg |= 268435456, o === 0 && (m.fg &= -268435457), m.updateExtended();
|
@@ -1127,10 +1181,10 @@ function ke() {
|
|
1127
1181
|
const m = o.length > 1 ? o.params[1] : 0;
|
1128
1182
|
switch (o.params[0]) {
|
1129
1183
|
case 14:
|
1130
|
-
m !== 2 && this._onRequestWindowsOptionsReport.fire(
|
1184
|
+
m !== 2 && this._onRequestWindowsOptionsReport.fire(D.GET_WIN_SIZE_PIXELS);
|
1131
1185
|
break;
|
1132
1186
|
case 16:
|
1133
|
-
this._onRequestWindowsOptionsReport.fire(
|
1187
|
+
this._onRequestWindowsOptionsReport.fire(D.GET_CELL_SIZE_PIXELS);
|
1134
1188
|
break;
|
1135
1189
|
case 18:
|
1136
1190
|
this._bufferService && this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);
|
@@ -1160,11 +1214,11 @@ function ke() {
|
|
1160
1214
|
for (; g.length > 1; ) {
|
1161
1215
|
const b = g.shift(), A = g.shift();
|
1162
1216
|
if (/^\d+$/.exec(b)) {
|
1163
|
-
const
|
1164
|
-
if (
|
1217
|
+
const P = parseInt(b);
|
1218
|
+
if (X(P)) if (A === "?") m.push({ type: 0, index: P });
|
1165
1219
|
else {
|
1166
|
-
const
|
1167
|
-
|
1220
|
+
const W = (0, T.parseColor)(A);
|
1221
|
+
W && m.push({ type: 1, index: P, color: W });
|
1168
1222
|
}
|
1169
1223
|
}
|
1170
1224
|
}
|
@@ -1178,7 +1232,7 @@ function ke() {
|
|
1178
1232
|
this._getCurrentLinkId() && this._finishHyperlink();
|
1179
1233
|
const g = o.split(":");
|
1180
1234
|
let b;
|
1181
|
-
const A = g.findIndex((
|
1235
|
+
const A = g.findIndex((P) => P.startsWith("id="));
|
1182
1236
|
return A !== -1 && (b = g[A].slice(3) || void 0), this._curAttrData.extended = this._curAttrData.extended.clone(), this._curAttrData.extended.urlId = this._oscLinkService.registerLink({ id: b, uri: m }), this._curAttrData.updateExtended(), !0;
|
1183
1237
|
}
|
1184
1238
|
_finishHyperlink() {
|
@@ -1188,7 +1242,7 @@ function ke() {
|
|
1188
1242
|
const g = o.split(";");
|
1189
1243
|
for (let b = 0; b < g.length && !(m >= this._specialColors.length); ++b, ++m) if (g[b] === "?") this._onColor.fire([{ type: 0, index: this._specialColors[m] }]);
|
1190
1244
|
else {
|
1191
|
-
const A = (0,
|
1245
|
+
const A = (0, T.parseColor)(g[b]);
|
1192
1246
|
A && this._onColor.fire([{ type: 1, index: this._specialColors[m], color: A }]);
|
1193
1247
|
}
|
1194
1248
|
return !0;
|
@@ -1207,7 +1261,7 @@ function ke() {
|
|
1207
1261
|
const m = [], g = o.split(";");
|
1208
1262
|
for (let b = 0; b < g.length; ++b) if (/^\d+$/.exec(g[b])) {
|
1209
1263
|
const A = parseInt(g[b]);
|
1210
|
-
|
1264
|
+
X(A) && m.push({ type: 2, index: A });
|
1211
1265
|
}
|
1212
1266
|
return m.length && this._onColor.fire(m), !0;
|
1213
1267
|
}
|
@@ -1278,7 +1332,7 @@ function ke() {
|
|
1278
1332
|
}
|
1279
1333
|
}
|
1280
1334
|
t.InputHandler = V;
|
1281
|
-
let
|
1335
|
+
let U = class {
|
1282
1336
|
constructor(H) {
|
1283
1337
|
this._bufferService = H, this.clearRange();
|
1284
1338
|
}
|
@@ -1295,10 +1349,10 @@ function ke() {
|
|
1295
1349
|
this.markRangeDirty(0, this._bufferService.rows - 1);
|
1296
1350
|
}
|
1297
1351
|
};
|
1298
|
-
function
|
1352
|
+
function X(H) {
|
1299
1353
|
return 0 <= H && H < 256;
|
1300
1354
|
}
|
1301
|
-
|
1355
|
+
U = d([_(0, p.IBufferService)], U);
|
1302
1356
|
}, 844: (w, t) => {
|
1303
1357
|
function l(d) {
|
1304
1358
|
for (const _ of d) _.dispose();
|
@@ -1681,50 +1735,50 @@ function ke() {
|
|
1681
1735
|
for (let y = this.lines.length - 1; y >= 0; y--) {
|
1682
1736
|
let C = this.lines.get(y);
|
1683
1737
|
if (!C || !C.isWrapped && C.getTrimmedLength() <= i) continue;
|
1684
|
-
const
|
1685
|
-
for (; C.isWrapped && y > 0; ) C = this.lines.get(--y),
|
1738
|
+
const T = [C];
|
1739
|
+
for (; C.isWrapped && y > 0; ) C = this.lines.get(--y), T.unshift(C);
|
1686
1740
|
const $ = this.ybase + this.y;
|
1687
|
-
if ($ >= y && $ < y +
|
1688
|
-
const E =
|
1741
|
+
if ($ >= y && $ < y + T.length) continue;
|
1742
|
+
const E = T[T.length - 1].getTrimmedLength(), B = (0, a.reflowSmallerGetNewLineLengths)(T, this._cols, i), D = B.length - T.length;
|
1689
1743
|
let G;
|
1690
|
-
G = this.ybase === 0 && this.y !== this.lines.length - 1 ? Math.max(0, this.y - this.lines.maxLength +
|
1744
|
+
G = this.ybase === 0 && this.y !== this.lines.length - 1 ? Math.max(0, this.y - this.lines.maxLength + D) : Math.max(0, this.lines.length - this.lines.maxLength + D);
|
1691
1745
|
const V = [];
|
1692
|
-
for (let g = 0; g <
|
1746
|
+
for (let g = 0; g < D; g++) {
|
1693
1747
|
const b = this.getBlankLine(c.DEFAULT_ATTR_DATA, !0);
|
1694
1748
|
V.push(b);
|
1695
1749
|
}
|
1696
|
-
V.length > 0 && (p.push({ start: y +
|
1697
|
-
let
|
1698
|
-
|
1699
|
-
let H =
|
1750
|
+
V.length > 0 && (p.push({ start: y + T.length + S, newLines: V }), S += V.length), T.push(...V);
|
1751
|
+
let U = B.length - 1, X = B[U];
|
1752
|
+
X === 0 && (U--, X = B[U]);
|
1753
|
+
let H = T.length - D - 1, o = E;
|
1700
1754
|
for (; H >= 0; ) {
|
1701
|
-
const g = Math.min(o,
|
1702
|
-
if (
|
1703
|
-
if (
|
1755
|
+
const g = Math.min(o, X);
|
1756
|
+
if (T[U] === void 0) break;
|
1757
|
+
if (T[U].copyCellsFrom(T[H], o - g, X - g, g, !0), X -= g, X === 0 && (U--, X = B[U]), o -= g, o === 0) {
|
1704
1758
|
H--;
|
1705
1759
|
const b = Math.max(H, 0);
|
1706
|
-
o = (0, a.getWrappedLineTrimmedLength)(
|
1760
|
+
o = (0, a.getWrappedLineTrimmedLength)(T, b, this._cols);
|
1707
1761
|
}
|
1708
1762
|
}
|
1709
|
-
for (let g = 0; g <
|
1710
|
-
let m =
|
1763
|
+
for (let g = 0; g < T.length; g++) B[g] < i && T[g].setCell(B[g], f);
|
1764
|
+
let m = D - G;
|
1711
1765
|
for (; m-- > 0; ) this.ybase === 0 ? this.y < s - 1 ? (this.y++, this.lines.pop()) : (this.ybase++, this.ydisp++) : this.ybase < Math.min(this.lines.maxLength, this.lines.length + S) - s && (this.ybase === this.ydisp && this.ydisp++, this.ybase++);
|
1712
|
-
this.savedY = Math.min(this.savedY +
|
1766
|
+
this.savedY = Math.min(this.savedY + D, this.ybase + s - 1);
|
1713
1767
|
}
|
1714
1768
|
if (p.length > 0) {
|
1715
1769
|
const y = [], C = [];
|
1716
|
-
for (let
|
1717
|
-
const
|
1718
|
-
let $ =
|
1770
|
+
for (let U = 0; U < this.lines.length; U++) C.push(this.lines.get(U));
|
1771
|
+
const T = this.lines.length;
|
1772
|
+
let $ = T - 1, E = 0, B = p[E];
|
1719
1773
|
this.lines.length = Math.min(this.lines.maxLength, this.lines.length + S);
|
1720
|
-
let
|
1721
|
-
for (let
|
1722
|
-
for (let
|
1723
|
-
|
1724
|
-
} else this.lines.set(
|
1774
|
+
let D = 0;
|
1775
|
+
for (let U = Math.min(this.lines.maxLength - 1, T + S - 1); U >= 0; U--) if (B && B.start > $ + D) {
|
1776
|
+
for (let X = B.newLines.length - 1; X >= 0; X--) this.lines.set(U--, B.newLines[X]);
|
1777
|
+
U++, y.push({ index: $ + 1, amount: B.newLines.length }), D += B.newLines.length, B = p[++E];
|
1778
|
+
} else this.lines.set(U, C[$--]);
|
1725
1779
|
let G = 0;
|
1726
|
-
for (let
|
1727
|
-
const V = Math.max(0,
|
1780
|
+
for (let U = y.length - 1; U >= 0; U--) y[U].index += G, this.lines.onInsertEmitter.fire(y[U]), G += y[U].amount;
|
1781
|
+
const V = Math.max(0, T + S - this.lines.maxLength);
|
1728
1782
|
V > 0 && this.lines.onTrimEmitter.fire(V);
|
1729
1783
|
}
|
1730
1784
|
}
|
@@ -1962,7 +2016,7 @@ function ke() {
|
|
1962
2016
|
}
|
1963
2017
|
let s = 0, f = l(i, s, _), p = 1, S = 0;
|
1964
2018
|
for (; p < i.length; ) {
|
1965
|
-
const C = l(i, p, _),
|
2019
|
+
const C = l(i, p, _), T = C - S, $ = n - f, E = Math.min(T, $);
|
1966
2020
|
i[s].copyCellsFrom(i[p], S, f, E, !1), f += E, f === n && (s++, f = 0), S += E, S === C && (p++, S = 0), f === 0 && s !== 0 && i[s - 1].getWidth(n - 1) === 2 && (i[s].copyCellsFrom(i[s - 1], n - 1, f++, 1, !1), i[s - 1].setCell(n - 1, a));
|
1967
2021
|
}
|
1968
2022
|
i[s].replaceCells(f, n, a);
|
@@ -2159,8 +2213,8 @@ function ke() {
|
|
2159
2213
|
p &= (224 & p) == 192 ? 31 : (240 & p) == 224 ? 15 : 7;
|
2160
2214
|
let S, y = 0;
|
2161
2215
|
for (; (S = 63 & this.interim[++y]) && y < 4; ) p <<= 6, p |= S;
|
2162
|
-
const C = (224 & this.interim[0]) == 192 ? 2 : (240 & this.interim[0]) == 224 ? 3 : 4,
|
2163
|
-
for (; r <
|
2216
|
+
const C = (224 & this.interim[0]) == 192 ? 2 : (240 & this.interim[0]) == 224 ? 3 : 4, T = C - y;
|
2217
|
+
for (; r < T; ) {
|
2164
2218
|
if (r >= _) return 0;
|
2165
2219
|
if (S = l[r++], (192 & S) != 128) {
|
2166
2220
|
r--, f = !0;
|
@@ -2550,17 +2604,17 @@ function ke() {
|
|
2550
2604
|
else {
|
2551
2605
|
if (s === void 0 || this._parseStack.state === 1) throw this._parseStack.state = 1, new Error("improper continuation due to previous async handler, giving up parsing");
|
2552
2606
|
const C = this._parseStack.handlers;
|
2553
|
-
let
|
2607
|
+
let T = this._parseStack.handlerPos - 1;
|
2554
2608
|
switch (this._parseStack.state) {
|
2555
2609
|
case 3:
|
2556
|
-
if (s === !1 &&
|
2557
|
-
for (;
|
2610
|
+
if (s === !1 && T > -1) {
|
2611
|
+
for (; T >= 0 && (f = C[T](this._params), f !== !0); T--) if (f instanceof Promise) return this._parseStack.handlerPos = T, f;
|
2558
2612
|
}
|
2559
2613
|
this._parseStack.handlers = [];
|
2560
2614
|
break;
|
2561
2615
|
case 4:
|
2562
|
-
if (s === !1 &&
|
2563
|
-
for (;
|
2616
|
+
if (s === !1 && T > -1) {
|
2617
|
+
for (; T >= 0 && (f = C[T](), f !== !0); T--) if (f instanceof Promise) return this._parseStack.handlerPos = T, f;
|
2564
2618
|
}
|
2565
2619
|
this._parseStack.handlers = [];
|
2566
2620
|
break;
|
@@ -2577,21 +2631,21 @@ function ke() {
|
|
2577
2631
|
for (let C = y; C < i; ++C) {
|
2578
2632
|
switch (p = r[C], S = this._transitions.table[this.currentState << 8 | (p < 160 ? p : h)], S >> 4) {
|
2579
2633
|
case 2:
|
2580
|
-
for (let
|
2581
|
-
if (
|
2582
|
-
this._printHandler(r, C,
|
2634
|
+
for (let D = C + 1; ; ++D) {
|
2635
|
+
if (D >= i || (p = r[D]) < 32 || p > 126 && p < h) {
|
2636
|
+
this._printHandler(r, C, D), C = D - 1;
|
2583
2637
|
break;
|
2584
2638
|
}
|
2585
|
-
if (++
|
2586
|
-
this._printHandler(r, C,
|
2639
|
+
if (++D >= i || (p = r[D]) < 32 || p > 126 && p < h) {
|
2640
|
+
this._printHandler(r, C, D), C = D - 1;
|
2587
2641
|
break;
|
2588
2642
|
}
|
2589
|
-
if (++
|
2590
|
-
this._printHandler(r, C,
|
2643
|
+
if (++D >= i || (p = r[D]) < 32 || p > 126 && p < h) {
|
2644
|
+
this._printHandler(r, C, D), C = D - 1;
|
2591
2645
|
break;
|
2592
2646
|
}
|
2593
|
-
if (++
|
2594
|
-
this._printHandler(r, C,
|
2647
|
+
if (++D >= i || (p = r[D]) < 32 || p > 126 && p < h) {
|
2648
|
+
this._printHandler(r, C, D), C = D - 1;
|
2595
2649
|
break;
|
2596
2650
|
}
|
2597
2651
|
}
|
@@ -2605,9 +2659,9 @@ function ke() {
|
|
2605
2659
|
if (this._errorHandler({ position: C, code: p, currentState: this.currentState, collect: this._collect, params: this._params, abort: !1 }).abort) return;
|
2606
2660
|
break;
|
2607
2661
|
case 7:
|
2608
|
-
const
|
2609
|
-
let $ =
|
2610
|
-
for (; $ >= 0 && (f =
|
2662
|
+
const T = this._csiHandlers[this._collect << 8 | p];
|
2663
|
+
let $ = T ? T.length - 1 : -1;
|
2664
|
+
for (; $ >= 0 && (f = T[$](this._params), f !== !0); $--) if (f instanceof Promise) return this._preserveStack(3, T, $, S, C), f;
|
2611
2665
|
$ < 0 && this._csiHandlerFb(this._collect << 8 | p, this._params), this.precedingJoinState = 0;
|
2612
2666
|
break;
|
2613
2667
|
case 8:
|
@@ -2641,8 +2695,8 @@ function ke() {
|
|
2641
2695
|
this._dcsParser.hook(this._collect << 8 | p, this._params);
|
2642
2696
|
break;
|
2643
2697
|
case 13:
|
2644
|
-
for (let
|
2645
|
-
this._dcsParser.put(r, C,
|
2698
|
+
for (let D = C + 1; ; ++D) if (D >= i || (p = r[D]) === 24 || p === 26 || p === 27 || p > 127 && p < h) {
|
2699
|
+
this._dcsParser.put(r, C, D), C = D - 1;
|
2646
2700
|
break;
|
2647
2701
|
}
|
2648
2702
|
break;
|
@@ -2654,8 +2708,8 @@ function ke() {
|
|
2654
2708
|
this._oscParser.start();
|
2655
2709
|
break;
|
2656
2710
|
case 5:
|
2657
|
-
for (let
|
2658
|
-
this._oscParser.put(r, C,
|
2711
|
+
for (let D = C + 1; ; D++) if (D >= i || (p = r[D]) < 32 || p > 127 && p < h) {
|
2712
|
+
this._oscParser.put(r, C, D), C = D - 1;
|
2659
2713
|
break;
|
2660
2714
|
}
|
2661
2715
|
break;
|
@@ -3037,10 +3091,10 @@ function ke() {
|
|
3037
3091
|
};
|
3038
3092
|
}, 753: function(w, t, l) {
|
3039
3093
|
var d = this && this.__decorate || function(s, f, p, S) {
|
3040
|
-
var y, C = arguments.length,
|
3041
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
3042
|
-
else for (var $ = s.length - 1; $ >= 0; $--) (y = s[$]) && (
|
3043
|
-
return C > 3 &&
|
3094
|
+
var y, C = arguments.length, T = C < 3 ? f : S === null ? S = Object.getOwnPropertyDescriptor(f, p) : S;
|
3095
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") T = Reflect.decorate(s, f, p, S);
|
3096
|
+
else for (var $ = s.length - 1; $ >= 0; $--) (y = s[$]) && (T = (C < 3 ? y(T) : C > 3 ? y(f, p, T) : y(f, p)) || T);
|
3097
|
+
return C > 3 && T && Object.defineProperty(f, p, T), T;
|
3044
3098
|
}, _ = this && this.__param || function(s, f) {
|
3045
3099
|
return function(p, S) {
|
3046
3100
|
f(p, S, s);
|
@@ -3115,7 +3169,7 @@ function ke() {
|
|
3115
3169
|
var d = this && this.__decorate || function(i, s, f, p) {
|
3116
3170
|
var S, y = arguments.length, C = y < 3 ? s : p === null ? p = Object.getOwnPropertyDescriptor(s, f) : p;
|
3117
3171
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") C = Reflect.decorate(i, s, f, p);
|
3118
|
-
else for (var
|
3172
|
+
else for (var T = i.length - 1; T >= 0; T--) (S = i[T]) && (C = (y < 3 ? S(C) : y > 3 ? S(s, f, C) : S(s, f)) || C);
|
3119
3173
|
return y > 3 && C && Object.defineProperty(s, f, C), C;
|
3120
3174
|
}, _ = this && this.__param || function(i, s) {
|
3121
3175
|
return function(f, p) {
|
@@ -3493,18 +3547,18 @@ function ke() {
|
|
3493
3547
|
}
|
3494
3548
|
}
|
3495
3549
|
t.Terminal = c;
|
3496
|
-
} },
|
3497
|
-
function
|
3498
|
-
var t =
|
3550
|
+
} }, I = {};
|
3551
|
+
function k(w) {
|
3552
|
+
var t = I[w];
|
3499
3553
|
if (t !== void 0) return t.exports;
|
3500
|
-
var l =
|
3501
|
-
return
|
3554
|
+
var l = I[w] = { exports: {} };
|
3555
|
+
return O[w].call(l.exports, l, l.exports, k), l.exports;
|
3502
3556
|
}
|
3503
|
-
var
|
3557
|
+
var R = {};
|
3504
3558
|
(() => {
|
3505
|
-
var w =
|
3559
|
+
var w = R;
|
3506
3560
|
Object.defineProperty(w, "__esModule", { value: !0 }), w.Terminal = void 0;
|
3507
|
-
const t =
|
3561
|
+
const t = k(285), l = k(975), d = k(90), _ = k(781), n = k(741), c = k(844), a = ["cols", "rows"];
|
3508
3562
|
class h extends c.Disposable {
|
3509
3563
|
constructor(e) {
|
3510
3564
|
super(), this._core = this.register(new _.Terminal(e)), this._addonManager = this.register(new n.AddonManager()), this._publicOptions = { ...this._core.options };
|
@@ -3643,15 +3697,15 @@ function ke() {
|
|
3643
3697
|
}
|
3644
3698
|
w.Terminal = h;
|
3645
3699
|
})();
|
3646
|
-
var
|
3647
|
-
for (var
|
3648
|
-
|
3700
|
+
var q = L;
|
3701
|
+
for (var N in R) q[N] = R[N];
|
3702
|
+
R.__esModule && Object.defineProperty(q, "__esModule", { value: !0 });
|
3649
3703
|
})();
|
3650
3704
|
}(ie)), ie;
|
3651
3705
|
}
|
3652
|
-
var
|
3653
|
-
function
|
3654
|
-
return new
|
3706
|
+
var De = Le();
|
3707
|
+
function xe() {
|
3708
|
+
return new De.Terminal({
|
3655
3709
|
cols: 1e3,
|
3656
3710
|
rows: 500,
|
3657
3711
|
allowProposedApi: !0,
|
@@ -3660,61 +3714,61 @@ function Le() {
|
|
3660
3714
|
cursorBlink: !1
|
3661
3715
|
});
|
3662
3716
|
}
|
3663
|
-
const
|
3664
|
-
maxCharacterLength:
|
3717
|
+
const Pe = {
|
3718
|
+
maxCharacterLength: ge
|
3665
3719
|
};
|
3666
|
-
function
|
3667
|
-
const
|
3668
|
-
for (let
|
3669
|
-
const w =
|
3720
|
+
function He(L, O = Pe) {
|
3721
|
+
const I = L.buffer.active, k = [], R = Math.max(0, O.maxCharacterLength);
|
3722
|
+
for (let N = 0; N < I.length; N++) {
|
3723
|
+
const w = I.getLine(N);
|
3670
3724
|
if (!w)
|
3671
3725
|
continue;
|
3672
3726
|
const t = w.translateToString(!1).trimEnd();
|
3673
|
-
t.trim().length === 0 &&
|
3727
|
+
t.trim().length === 0 && k.at(-1)?.trim().length === 0 || k.push(t);
|
3674
3728
|
}
|
3675
|
-
let
|
3676
|
-
for (let
|
3677
|
-
const w =
|
3678
|
-
if (
|
3679
|
-
const l =
|
3729
|
+
let q = 0;
|
3730
|
+
for (let N = k.length - 1; N > 0; N--) {
|
3731
|
+
const w = k[N];
|
3732
|
+
if (q += w.length, q > R) {
|
3733
|
+
const l = N, d = `Truncated ${l} ${ve(l, "line")} above this point`, _ = k.length - N - 1, n = _ === 1 ? "Below is the last line of the output" : `Below are the last ${_} lines of the output`;
|
3680
3734
|
return {
|
3681
3735
|
output: [
|
3682
3736
|
`--- ${d}. ${n}. ---`,
|
3683
|
-
...
|
3737
|
+
...k.slice(N)
|
3684
3738
|
].join(`
|
3685
3739
|
`),
|
3686
|
-
hidden_truncatedOutput:
|
3740
|
+
hidden_truncatedOutput: k.slice(0, N).join(`
|
3687
3741
|
`)
|
3688
3742
|
};
|
3689
3743
|
}
|
3690
3744
|
}
|
3691
3745
|
return {
|
3692
|
-
output:
|
3746
|
+
output: k.join(`
|
3693
3747
|
`)
|
3694
3748
|
};
|
3695
3749
|
}
|
3696
|
-
function
|
3697
|
-
const
|
3698
|
-
return
|
3699
|
-
|
3700
|
-
|
3750
|
+
function Re(L, O, I) {
|
3751
|
+
const k = xe();
|
3752
|
+
return Ce(
|
3753
|
+
L,
|
3754
|
+
O.settings["terminal.commands.nodeSpawn.loadProfile"]
|
3701
3755
|
).pipe(
|
3702
|
-
|
3703
|
-
(
|
3704
|
-
shell:
|
3705
|
-
cwd:
|
3756
|
+
oe(
|
3757
|
+
(R) => me(I.cmd, [], {
|
3758
|
+
shell: le.userInfo().shell || !0,
|
3759
|
+
cwd: L,
|
3706
3760
|
stdio: ["ignore", "pipe", "pipe"],
|
3707
|
-
env:
|
3761
|
+
env: R
|
3708
3762
|
})
|
3709
3763
|
),
|
3710
|
-
|
3764
|
+
oe(({ lastData: R, exitCode: q, exited: N }) => be(
|
3711
3765
|
new Promise((w) => {
|
3712
|
-
const t =
|
3713
|
-
|
3714
|
-
const { output: l } =
|
3715
|
-
w(
|
3766
|
+
const t = R?.subarray() ?? new Uint8Array();
|
3767
|
+
k.write(t, () => {
|
3768
|
+
const { output: l } = He(k);
|
3769
|
+
w(N ? {
|
3716
3770
|
status: "done",
|
3717
|
-
result: { output: l, exitCode:
|
3771
|
+
result: { output: l, exitCode: q ?? -1 }
|
3718
3772
|
} : {
|
3719
3773
|
status: "in-progress",
|
3720
3774
|
progress: { output: l }
|
@@ -3724,50 +3778,50 @@ function Pe(x, j, O) {
|
|
3724
3778
|
))
|
3725
3779
|
);
|
3726
3780
|
}
|
3727
|
-
const
|
3728
|
-
|
3729
|
-
const
|
3781
|
+
const Ne = ({ args: L, userInput: O }, { dir: I, dirs: k, config: R, toolMessages: q }) => {
|
3782
|
+
Se(I);
|
3783
|
+
const N = fe(I.fsPath, L.cwd ? Me(L.cwd) : "."), w = (c) => ({
|
3730
3784
|
status: "done",
|
3731
3785
|
result: {
|
3732
3786
|
output: `Error: ${c}`,
|
3733
3787
|
exitCode: 1
|
3734
3788
|
}
|
3735
|
-
}), t =
|
3789
|
+
}), t = Oe(L.cmd);
|
3736
3790
|
if (t)
|
3737
3791
|
return se.of(w(t));
|
3738
|
-
const l =
|
3792
|
+
const l = Ie(N);
|
3739
3793
|
if (l)
|
3740
3794
|
return se.of(w(l));
|
3741
|
-
const d = [
|
3742
|
-
config:
|
3795
|
+
const d = [N, ...k.map((c) => c.fsPath)], _ = ke(L.cmd, d, {
|
3796
|
+
config: R.settings
|
3743
3797
|
}), n = _.parts.flatMap(
|
3744
3798
|
(c) => (
|
3745
3799
|
// Only offer adding program to allowlist when parsable, non-dynamic, non-concatenated, and within cwd.
|
3746
3800
|
c.requiresConfirmation ? typeof c.command == "string" || c.command.program === ne || Array.isArray(c.command.program) || c.command.arguments.some(
|
3747
|
-
(a) => a === ne || typeof a == "string" &&
|
3801
|
+
(a) => a === ne || typeof a == "string" && ue(a, d)
|
3748
3802
|
) ? [] : [c.command.program] : []
|
3749
3803
|
)
|
3750
3804
|
);
|
3751
3805
|
if (_.requiresConfirmation) {
|
3752
|
-
if (
|
3806
|
+
if (O && !O.accepted)
|
3753
3807
|
return se.of({ status: "rejected-by-user", toAllow: n });
|
3754
|
-
if (!
|
3808
|
+
if (!O?.accepted)
|
3755
3809
|
return se.of({ status: "blocked-on-user", toAllow: n });
|
3756
3810
|
}
|
3757
|
-
return
|
3758
|
-
},
|
3759
|
-
function
|
3760
|
-
return
|
3811
|
+
return R.settings["terminal.commands.environment"], Re(N, R, L);
|
3812
|
+
}, ce = le.homedir();
|
3813
|
+
function Me(L) {
|
3814
|
+
return ce ? L.replace(/^~(?=$|\/|\\)/, ce) : L;
|
3761
3815
|
}
|
3762
|
-
function
|
3763
|
-
if (typeof
|
3816
|
+
function Oe(L) {
|
3817
|
+
if (typeof L != "string")
|
3764
3818
|
return "`cmd` must be a string representing a command.";
|
3765
3819
|
}
|
3766
|
-
function
|
3767
|
-
if (
|
3820
|
+
function Ie(L) {
|
3821
|
+
if (L !== void 0 && typeof L != "string")
|
3768
3822
|
return "`cwd` must be a string representing a relative path within the workspace.";
|
3769
3823
|
}
|
3770
3824
|
export {
|
3771
|
-
|
3825
|
+
Ne as nodeBashTool
|
3772
3826
|
};
|
3773
|
-
//# sourceMappingURL=node-
|
3827
|
+
//# sourceMappingURL=node-C9D1REPh.js.map
|