terminfo.dev 1.6.1 → 1.7.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/index.ts +10 -7
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -61,10 +61,11 @@ async function runProbes(): Promise<ProbeResults> {
|
|
|
61
61
|
const responses: Record<string, string> = {}
|
|
62
62
|
let passed = 0
|
|
63
63
|
|
|
64
|
+
// Save cursor + scroll position, run probes, restore
|
|
65
|
+
process.stdout.write("\x1b7") // save cursor (DECSC)
|
|
66
|
+
|
|
64
67
|
await withRawMode(async () => {
|
|
65
|
-
process.stdout.write("\x1b[?1049h\x1b[2J\x1b[H")
|
|
66
68
|
for (const probe of ALL_PROBES) {
|
|
67
|
-
process.stdout.write("\x1b[2J\x1b[H")
|
|
68
69
|
try {
|
|
69
70
|
const result = await probe.run()
|
|
70
71
|
results[probe.id] = result.pass
|
|
@@ -76,12 +77,14 @@ async function runProbes(): Promise<ProbeResults> {
|
|
|
76
77
|
notes[probe.id] = `error: ${err instanceof Error ? err.message : String(err)}`
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
|
-
|
|
80
|
-
process.stdout.write("\x1b[0m\x1b[2J\x1b[H")
|
|
81
|
-
await drainStdin(500)
|
|
82
|
-
process.stdout.write("\x1b[?1049l")
|
|
80
|
+
await drainStdin(1000)
|
|
83
81
|
})
|
|
84
82
|
|
|
83
|
+
// Restore terminal state completely
|
|
84
|
+
process.stdout.write("\x1b8") // restore cursor (DECRC)
|
|
85
|
+
process.stdout.write("\x1bc") // RIS — full terminal reset
|
|
86
|
+
// RIS moves cursor to 1,1 — that's fine, we're about to print results
|
|
87
|
+
|
|
85
88
|
return { terminal, results, notes, responses, passed, total: ALL_PROBES.length }
|
|
86
89
|
}
|
|
87
90
|
|
|
@@ -212,7 +215,7 @@ program
|
|
|
212
215
|
notes: data.notes,
|
|
213
216
|
responses: data.responses,
|
|
214
217
|
generated: new Date().toISOString(),
|
|
215
|
-
cliVersion: "1.
|
|
218
|
+
cliVersion: "1.7.0",
|
|
216
219
|
probeCount: ALL_PROBES.length,
|
|
217
220
|
})
|
|
218
221
|
if (url) {
|