Skip to content

fix(permissions): swallow SPACE in dialog to prevent stray approval - #3567

Closed
Ricardo-M-L wants to merge 1 commit into
charmbracelet:mainfrom
Ricardo-M-L:fix/permission-space-keybind
Closed

fix(permissions): swallow SPACE in dialog to prevent stray approval#3567
Ricardo-M-L wants to merge 1 commit into
charmbracelet:mainfrom
Ricardo-M-L:fix/permission-space-keybind

Conversation

@Ricardo-M-L

Copy link
Copy Markdown
Contributor

This PR addresses: fix(permissions): swallow SPACE in dialog to prevent stray approval

Closes charmbracelet#2799. When the user is typing in the chat editor and a
permissions dialog opens, an in-flight SPACE keystroke could be
delivered to the dialog. The viewport's default `KeyMap.PageDown`
binding includes "space"; the dialog disables that binding via
`key.NewBinding(key.WithDisabled())`, so SPACE doesn't currently
*approve*, but the experience is still surprising — depending on
focus/timing the keystroke can still cause the dialog to react.

Add an explicit early return for SPACE in the dialog's KeyPressMsg
handler, before any other matching. The dialog now requires an
explicit Enter / a / s / d / mouse click to act, matching what the
issue requests.
@Ricardo-M-L Ricardo-M-L changed the title fix: fix(permissions): swallow SPACE in dialog to prevent stray approval fix(permissions): swallow SPACE in dialog to prevent stray approval Aug 17, 2026
@Ricardo-M-L

Copy link
Copy Markdown
Contributor Author

Superseded by clean rebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant