Fix Shift+Enter, Option+Delete, Cmd+Delete in task form fields#541
Open
bborn wants to merge 2 commits into
Open
Fix Shift+Enter, Option+Delete, Cmd+Delete in task form fields#541bborn wants to merge 2 commits into
bborn wants to merge 2 commits into
Conversation
Modern macOS terminals (Ghostty, WezTerm, Kitty, iTerm2 with modifyOtherKeys) send CSI-u escape sequences for keys like Shift+Enter and Cmd+Delete. Bubble Tea v1.3.10 reports these as unknownCSISequenceMsg rather than tea.KeyMsg, so they never reached the textinput/textarea bindings and silently did nothing in the new-task and edit-task forms. Translate the recognized sequences back into canonical tea.KeyMsg values at the top of FormModel.Update so the existing handlers do the work: - Shift+Enter -> KeyEnter (textarea inserts newline) - Option+Delete/Backspace -> alt+backspace (DeleteWordBackward) - Cmd+Delete/Backspace -> ctrl+u (DeleteBeforeCursor) - Cmd+Left / Cmd+Right -> ctrl+a / ctrl+e (line start/end) Unknown CSI sequences pass through unchanged. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
\x1b[13;2uand\x1b[127;9u, which Bubble Tea v1.3.10 emits asunknownCSISequenceMsgrather thantea.KeyMsg. The form only inspectedtea.KeyMsg, so the keys went nowhere.tea.KeyMsgvalues at the top ofFormModel.Update. The existing textinput/textarea bindings then do the work — no new edit logic.Mappings applied:
Unknown CSI sequences pass through unchanged, so non-targeted behavior is identical to before.
Test plan
go test ./...— all packages passgo test ./internal/ui/ -count=1 -race— clean under the race detectorgo vet ./...— cleaninternal/ui/key_csi_test.goexercise realunknownCSISequenceMsgvalues produced by a live Bubble Tea program and confirm each sequence maps to the righttea.KeyMsg(and that unknown / non-CSI messages pass through untouched).internal/ui/form_modern_keys_test.godriveFormModel.Updateand verify body/title edits for Shift+Enter, Option+Delete, and Cmd+Delete in both kitty and modifyOtherKeys forms — and confirm the legacytea.KeyMsgpaths still work.Notes / limitations
🤖 Generated with Claude Code