terminfo.dev 0.4.0 → 0.5.0
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/package.json +1 -1
- package/src/probes/index.ts +22 -13
package/package.json
CHANGED
package/src/probes/index.ts
CHANGED
|
@@ -316,28 +316,36 @@ const kittyKeyboard: Probe = {
|
|
|
316
316
|
},
|
|
317
317
|
}
|
|
318
318
|
|
|
319
|
-
const
|
|
320
|
-
id: "extensions.sixel",
|
|
321
|
-
name: "Sixel
|
|
319
|
+
const sixelDA1: Probe = {
|
|
320
|
+
id: "extensions.sixel-da1",
|
|
321
|
+
name: "Sixel advertised (DA1 bit 4)",
|
|
322
322
|
async run() {
|
|
323
|
-
// Check DA1 for sixel bit (;4) — some terminals advertise it
|
|
324
323
|
const match = await query("\x1b[c", /\x1b\[\?([0-9;]+)c/, 1000)
|
|
325
|
-
if (match) {
|
|
326
|
-
|
|
327
|
-
|
|
324
|
+
if (!match) return { pass: false, note: "No DA1 response" }
|
|
325
|
+
const attrs = match[1]!.split(";")
|
|
326
|
+
const hasSixel = attrs.includes("4")
|
|
327
|
+
return {
|
|
328
|
+
pass: hasSixel,
|
|
329
|
+
note: hasSixel ? undefined : "DA1 response missing ;4 (sixel)",
|
|
330
|
+
response: match[1],
|
|
328
331
|
}
|
|
329
|
-
|
|
330
|
-
|
|
332
|
+
},
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
const sixelRender: Probe = {
|
|
336
|
+
id: "extensions.sixel",
|
|
337
|
+
name: "Sixel graphics (render)",
|
|
338
|
+
async run() {
|
|
339
|
+
// Send a minimal sixel image and check if cursor moved
|
|
331
340
|
process.stdout.write("\x1b[1;1H") // move to 1;1
|
|
332
341
|
process.stdout.write("\x1bPq#0;2;0;0;0~-~\x1b\\") // tiny 1x2 sixel
|
|
333
342
|
const pos = await queryCursorPosition()
|
|
334
343
|
if (!pos) return { pass: false, note: "No cursor response after sixel" }
|
|
335
|
-
// If terminal parsed sixel, cursor
|
|
344
|
+
// If terminal parsed sixel, cursor should have moved
|
|
336
345
|
const moved = pos[0] > 1 || pos[1] > 1
|
|
337
346
|
return {
|
|
338
347
|
pass: moved,
|
|
339
|
-
note: moved ? undefined : "
|
|
340
|
-
response: match?.[1] ? `DA1: ${match[1]}` : undefined,
|
|
348
|
+
note: moved ? undefined : "Sixel image didn't move cursor",
|
|
341
349
|
}
|
|
342
350
|
},
|
|
343
351
|
}
|
|
@@ -459,7 +467,8 @@ export const ALL_PROBES: Probe[] = [
|
|
|
459
467
|
|
|
460
468
|
// Extensions
|
|
461
469
|
kittyKeyboard,
|
|
462
|
-
|
|
470
|
+
sixelDA1,
|
|
471
|
+
sixelRender,
|
|
463
472
|
osc52Clipboard,
|
|
464
473
|
osc7Cwd,
|
|
465
474
|
|