@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.
Files changed (2) hide show
  1. package/bin/mipham.ts +17 -11
  2. 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 software flow control (XON/XOFF) ──────────────────
312
- // Ctrl+S and Ctrl+Q are intercepted by the terminal for flow control by default.
313
- // Disabling it lets our app receive these key combinations (e.g. Agent Dashboard).
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 -ixon 2>/dev/null || true', { stdio: 'ignore' })
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 flow control to disable
323
+ // Non-POSIX platform (Windows) — no special chars to disable
319
324
  }
320
- // Restore flow control on exit
321
- const restoreFlowControl = () => {
325
+ // Restore original terminal settings on exit
326
+ const restoreTerminal = () => {
327
+ if (!savedStty) return
322
328
  try {
323
- execSync('stty ixon 2>/dev/null || true', { stdio: 'ignore' })
329
+ execSync(`stty ${savedStty} 2>/dev/null || true`, { stdio: 'ignore' })
324
330
  } catch {
325
331
  /* ignore */
326
332
  }
327
333
  }
328
- process.on('exit', restoreFlowControl)
329
- process.on('SIGINT', restoreFlowControl)
330
- process.on('SIGTERM', restoreFlowControl)
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')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miphamai/cli",
3
- "version": "0.24.11",
3
+ "version": "0.24.12",
4
4
  "description": "Mipham Code — Multi-model open-core intelligent coding terminal by MiphamAI",
5
5
  "keywords": [
6
6
  "ai",