Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

Suspend TUI global hotkeys during prompts

8 months ago

af896f9
Authored
mweinbach2/19/2026, 4:19:01 PM
Add a helper to gate global hotkeys while human-in-the-loop prompts are active and cover it with tests.

- Introduce shouldSuspendGlobalHotkeys(state) in apps/TUI/app.tsx which returns true when pendingAsk or pendingApproval is active.
- Use this helper in GlobalHotkeys to early-return so prompt UI can receive key events instead of being intercepted by global listeners.
- Add tests (test/tui.global-hotkeys.test.ts) using bun:test to verify hotkeys are suspended when ask or approval prompts are present and enabled otherwise.

Parent2abf9ed

2 files changed
  • apps/TUI/app.tsx+19−0
  • test/tui.global-hotkeys.test.ts+32−0