@miphamai/cli 0.24.12 → 0.24.13
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 +10 -5
- package/package.json +1 -1
package/bin/mipham.ts
CHANGED
|
@@ -311,13 +311,16 @@ async function main() {
|
|
|
311
311
|
// ── Disable terminal special characters ──────────────────────────────────
|
|
312
312
|
// Terminal intercepts Ctrl+S (XOFF), Ctrl+T (SIGINFO/status), Ctrl+R (rprnt)
|
|
313
313
|
// before the app sees them. Disable these so Agent Dashboard shortcuts work.
|
|
314
|
+
// IMPORTANT: stty needs the real terminal on stdin — 'ignore' won't work.
|
|
314
315
|
const { execSync } = await import('node:child_process')
|
|
315
316
|
let savedStty = ''
|
|
316
317
|
try {
|
|
317
|
-
savedStty = execSync('stty -g
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
318
|
+
savedStty = execSync('stty -g', {
|
|
319
|
+
encoding: 'utf-8',
|
|
320
|
+
stdio: ['inherit', 'pipe', 'ignore'],
|
|
321
|
+
}).trim()
|
|
322
|
+
execSync('stty -ixon stop undef start undef status undef rprnt undef', {
|
|
323
|
+
stdio: ['inherit', 'ignore', 'ignore'],
|
|
321
324
|
})
|
|
322
325
|
} catch {
|
|
323
326
|
// Non-POSIX platform (Windows) — no special chars to disable
|
|
@@ -326,7 +329,9 @@ async function main() {
|
|
|
326
329
|
const restoreTerminal = () => {
|
|
327
330
|
if (!savedStty) return
|
|
328
331
|
try {
|
|
329
|
-
execSync(`stty ${savedStty}
|
|
332
|
+
execSync(`stty ${savedStty}`, {
|
|
333
|
+
stdio: ['inherit', 'ignore', 'ignore'],
|
|
334
|
+
})
|
|
330
335
|
} catch {
|
|
331
336
|
/* ignore */
|
|
332
337
|
}
|