fix(textinput): handle shift+backspace in terminals with Kitty keyboard protocol#621
fix(textinput): handle shift+backspace in terminals with Kitty keyboard protocol#621matze wants to merge 1 commit intoidursun:mainfrom
Conversation
| ti := textinput.New() | ||
| common.PatchTextInputKeys(&ti) |
There was a problem hiding this comment.
if we were to introduce this change, instead of a "patch", i think it's better to have something like common.TextInputNew() that does what PathTextInputKeys is doing and textinput.New()
it should be able to remove this two-step (textinput.New then PatchTextInput) boilerplate
otherwise every caller of textinput.New needs to call the patch
There was a problem hiding this comment.
Changed to your suggestion and now without AI :-)
| ) | ||
| km.DeleteWordBackward.SetKeys( | ||
| append(km.DeleteWordBackward.Keys(), "shift+alt+backspace")..., | ||
| ) |
There was a problem hiding this comment.
intuitively, i think a DeleteWorkForward is missing?
…rd protocol Terminals like wezterm and ghostty on Linux report shift+backspace as a distinct key event via the Kitty keyboard protocol. The bubbles textinput default KeyMap only binds plain backspace, so shift+backspace was silently ignored. Add a PatchTextInputKeys helper that extends the KeyMap to also accept shift+backspace, shift+delete, and shift+alt+backspace, and apply it to all textinput instances. Fixes idursun#619
c5603a6 to
70e5e11
Compare
|
Hey sorry for the late reply, but shouldn't this contribution be sent to the downstream https://github.com/charmbracelet/bubbles repository instead? We don't own textarea/textinput and I personally don't think we should be patching downstream issues here. |
Disclaimer: I am not a Go developer and this was mostly figured out by Claude Code.
Terminals like wezterm and ghostty on Linux report shift+backspace as a distinct key event via the Kitty keyboard protocol. The bubbles textinput default KeyMap only binds plain backspace, so shift+backspace was silently ignored. Add a PatchTextInputKeys helper that extends the KeyMap to also accept shift+backspace, shift+delete, and shift+alt+backspace, and apply it to all textinput instances.
Fixes #619