terminfo.dev 0.4.0 → 0.6.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terminfo.dev",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Test your terminal's feature support and contribute to terminfo.dev",
5
5
  "keywords": [
6
6
  "ansi",
package/src/index.ts CHANGED
@@ -39,11 +39,16 @@ async function main() {
39
39
  const terminal = detectTerminal()
40
40
 
41
41
  if (!jsonMode) {
42
- console.log(`\x1b[1mterminfo\x1b[0m — terminal feature testing for terminfo.dev\n`)
43
- console.log(
44
- `Detected: \x1b[1m${terminal.name}\x1b[0m${terminal.version ? ` ${terminal.version}` : ""} on ${terminal.os}${terminal.osVersion ? ` ${terminal.osVersion}` : ""}`,
45
- )
46
- console.log(`Running ${ALL_PROBES.length} probes...\n`)
42
+ console.log(`\x1b[1mterminfo.dev\x1b[0m — can your terminal do that?\n`)
43
+ console.log(` Terminal: \x1b[1m${terminal.name}\x1b[0m${terminal.version ? ` ${terminal.version}` : ""}`)
44
+ console.log(` Platform: ${terminal.os}${terminal.osVersion ? ` ${terminal.osVersion}` : ""}`)
45
+ console.log(` Probes: ${ALL_PROBES.length} features across ${new Set(ALL_PROBES.map(p => p.id.split(".")[0])).size} categories`)
46
+ console.log(` Website: https://terminfo.dev`)
47
+ console.log(``)
48
+ console.log(`\x1b[2mResults are compared against ${ALL_PROBES.length} terminal features from the`)
49
+ console.log(`ECMA-48, VT100/VT510, xterm, and Kitty specifications.`)
50
+ console.log(`Run with --submit to contribute your results to the database.\x1b[0m\n`)
51
+ console.log(`Running probes...`)
47
52
  }
48
53
 
49
54
  const results: Record<string, boolean> = {}
@@ -316,28 +316,36 @@ const kittyKeyboard: Probe = {
316
316
  },
317
317
  }
318
318
 
319
- const sixelSupport: Probe = {
320
- id: "extensions.sixel",
321
- name: "Sixel graphics",
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
- const attrs = match[1]!.split(";")
327
- if (attrs.includes("4")) return { pass: true, response: `DA1: ${match[1]}` }
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
- // Fallback: send a minimal sixel image and check if cursor moved
330
- // DCS q = sixel start, #0;2;0;0;0 = color, ! = repeat, ~ = sixel data, ST = end
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 may have moved down
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 : "DA1 missing ;4 and sixel didn't move cursor",
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
- sixelSupport,
470
+ sixelDA1,
471
+ sixelRender,
463
472
  osc52Clipboard,
464
473
  osc7Cwd,
465
474