opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix: app_exit keybind ignored when using <leader> (including default <leader>q)

Open razor-x opened this issue 4 days ago • 2 comments

Fixes #3851

What does this PR do?

Summary

  • Add a global app_exit handler so leader key combos reach exit even when prompt focus is blurred, while still respecting the “only exit when prompt is empty” rule in packages/opencode/src/cli/cmd/tui/app.tsx:183. Why this fixes it
  • q was being consumed while the prompt was blurred by leader mode, so the prompt-level app_exit handler never ran. The new global handler uses useKeyboard and usePromptRef to exit consistently.

How did you verify your code works?

Built and ran locally, verified q exits the app as expected.

razor-x avatar Jan 13 '26 07:01 razor-x