@miphamai/cli 0.24.11 → 0.24.12
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/bin/mipham.ts +17 -11
- package/package.json +1 -1
package/bin/mipham.ts
CHANGED
|
@@ -308,26 +308,32 @@ async function runUpdate(): Promise<boolean> {
|
|
|
308
308
|
}
|
|
309
309
|
|
|
310
310
|
async function main() {
|
|
311
|
-
// ── Disable terminal
|
|
312
|
-
// Ctrl+S
|
|
313
|
-
//
|
|
311
|
+
// ── Disable terminal special characters ──────────────────────────────────
|
|
312
|
+
// Terminal intercepts Ctrl+S (XOFF), Ctrl+T (SIGINFO/status), Ctrl+R (rprnt)
|
|
313
|
+
// before the app sees them. Disable these so Agent Dashboard shortcuts work.
|
|
314
314
|
const { execSync } = await import('node:child_process')
|
|
315
|
+
let savedStty = ''
|
|
315
316
|
try {
|
|
316
|
-
execSync('stty -
|
|
317
|
+
savedStty = execSync('stty -g 2>/dev/null || true', { encoding: 'utf-8' }).trim()
|
|
318
|
+
// Disable: flow control (^S/^Q), status (^T), reprint (^R)
|
|
319
|
+
execSync('stty -ixon stop undef start undef status undef rprnt undef 2>/dev/null || true', {
|
|
320
|
+
stdio: 'ignore',
|
|
321
|
+
})
|
|
317
322
|
} catch {
|
|
318
|
-
// Non-POSIX platform (Windows) — no
|
|
323
|
+
// Non-POSIX platform (Windows) — no special chars to disable
|
|
319
324
|
}
|
|
320
|
-
// Restore
|
|
321
|
-
const
|
|
325
|
+
// Restore original terminal settings on exit
|
|
326
|
+
const restoreTerminal = () => {
|
|
327
|
+
if (!savedStty) return
|
|
322
328
|
try {
|
|
323
|
-
execSync(
|
|
329
|
+
execSync(`stty ${savedStty} 2>/dev/null || true`, { stdio: 'ignore' })
|
|
324
330
|
} catch {
|
|
325
331
|
/* ignore */
|
|
326
332
|
}
|
|
327
333
|
}
|
|
328
|
-
process.on('exit',
|
|
329
|
-
process.on('SIGINT',
|
|
330
|
-
process.on('SIGTERM',
|
|
334
|
+
process.on('exit', restoreTerminal)
|
|
335
|
+
process.on('SIGINT', restoreTerminal)
|
|
336
|
+
process.on('SIGTERM', restoreTerminal)
|
|
331
337
|
|
|
332
338
|
// ── Read version fresh from package.json at startup (bypasses Bun module cache) ──
|
|
333
339
|
const { readFileSync } = await import('node:fs')
|