terminfo.dev 2.1.0 → 2.2.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/detect.ts +15 -2
- package/src/index.ts +25 -10
package/package.json
CHANGED
package/src/detect.ts
CHANGED
|
@@ -36,6 +36,7 @@ const TERM_PROGRAM_MAP: Record<string, string> = {
|
|
|
36
36
|
|
|
37
37
|
/** Known macOS bundle IDs for version lookup */
|
|
38
38
|
const BUNDLE_IDS: Record<string, string> = {
|
|
39
|
+
cmux: "com.cmuxterm.app",
|
|
39
40
|
ghostty: "com.mitchellh.ghostty",
|
|
40
41
|
kitty: "net.kovidgoyal.kitty",
|
|
41
42
|
iterm2: "com.googlecode.iterm2",
|
|
@@ -61,9 +62,9 @@ export function detectTerminal(): TerminalInfo {
|
|
|
61
62
|
break
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
|
-
// If bundle ID didn't match known terminals,
|
|
65
|
+
// If bundle ID didn't match known terminals, show the full bundle ID
|
|
65
66
|
if (name === "unknown" && bundleId) {
|
|
66
|
-
name = bundleId
|
|
67
|
+
name = bundleId
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
|
|
@@ -92,6 +93,18 @@ export function detectTerminal(): TerminalInfo {
|
|
|
92
93
|
if (termEmu) name = termEmu.toLowerCase()
|
|
93
94
|
}
|
|
94
95
|
|
|
96
|
+
// Linux: check common env vars
|
|
97
|
+
if (name === "unknown") {
|
|
98
|
+
if (process.env.GNOME_TERMINAL_SCREEN) name = "gnome-terminal"
|
|
99
|
+
else if (process.env.KONSOLE_VERSION) { name = "konsole"; version = process.env.KONSOLE_VERSION }
|
|
100
|
+
else if (process.env.TILIX_ID) name = "tilix"
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Windows: check for Windows Terminal
|
|
104
|
+
if (name === "unknown" && os === "windows") {
|
|
105
|
+
if (process.env.WT_SESSION) name = "windows-terminal"
|
|
106
|
+
}
|
|
107
|
+
|
|
95
108
|
// Fallback: $TERM
|
|
96
109
|
if (name === "unknown") {
|
|
97
110
|
name = process.env.TERM ?? "unknown"
|
package/src/index.ts
CHANGED
|
@@ -187,17 +187,32 @@ program
|
|
|
187
187
|
|
|
188
188
|
printHeader(terminal)
|
|
189
189
|
console.log(``)
|
|
190
|
-
console.log(` Will submit results for \x1b[1m${name}${version ? ` ${version}` : ""}\x1b[0m on ${terminal.os}`)
|
|
191
|
-
if (!version) {
|
|
192
|
-
console.log(` \x1b[33m⚠ No version detected. Use --terminal-version to specify.\x1b[0m`)
|
|
193
|
-
}
|
|
194
190
|
|
|
191
|
+
// Let user confirm/edit terminal info before running probes
|
|
195
192
|
const { createInterface } = await import("node:readline")
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
rl
|
|
199
|
-
|
|
200
|
-
|
|
193
|
+
|
|
194
|
+
async function ask(question: string, defaultValue: string): Promise<string> {
|
|
195
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout })
|
|
196
|
+
return new Promise((resolve) => {
|
|
197
|
+
rl.question(` ${question} [\x1b[1m${defaultValue}\x1b[0m]: `, (answer) => {
|
|
198
|
+
rl.close()
|
|
199
|
+
resolve(answer.trim() || defaultValue)
|
|
200
|
+
})
|
|
201
|
+
})
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
name = await ask("Terminal name", name)
|
|
205
|
+
version = await ask("Terminal version", version || "unknown")
|
|
206
|
+
if (version === "unknown") version = ""
|
|
207
|
+
|
|
208
|
+
console.log(``)
|
|
209
|
+
console.log(` Submitting as \x1b[1m${name}${version ? ` ${version}` : ""}\x1b[0m on ${terminal.os}`)
|
|
210
|
+
|
|
211
|
+
const rl2 = createInterface({ input: process.stdin, output: process.stdout })
|
|
212
|
+
await new Promise<void>((resolve) => {
|
|
213
|
+
rl2.question(` Press Enter to run probes (Ctrl+C to cancel) `, () => {
|
|
214
|
+
rl2.close()
|
|
215
|
+
resolve()
|
|
201
216
|
})
|
|
202
217
|
})
|
|
203
218
|
|
|
@@ -215,7 +230,7 @@ program
|
|
|
215
230
|
notes: data.notes,
|
|
216
231
|
responses: data.responses,
|
|
217
232
|
generated: new Date().toISOString(),
|
|
218
|
-
cliVersion: "2.
|
|
233
|
+
cliVersion: "2.2.0",
|
|
219
234
|
probeCount: ALL_PROBES.length,
|
|
220
235
|
})
|
|
221
236
|
if (url) {
|