[PR #8151] fix: app_exit keybind ignored when using <leader> (including default <leader>q) #12635

Open
opened 2026-02-16 18:17:32 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8151

State: open
Merged: No


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.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8151 **State:** open **Merged:** No --- 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 - <leader>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 <leader>q exits the app as expected.
yindo added the pull-request label 2026-02-16 18:17:32 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12635