Repository navigation
macos: send all insertText commits as key events - #13817
Merged
Merged
Conversation
Previously, insertText commits without marked text were delivered via sendText, which applies paste semantics and wraps the text in bracketed paste when the program enables it. macOS dictation and other input methods often commit without marked text, so programs treated dictated text as a paste and applied paste-specific handling. insertText is only invoked by input methods (IME, dictation, emoji picker, character viewer); real paste operations use a separate path. Send every non-empty commit through the key event path so programs interpret input method text as typed input. Typing is unaffected (the accumulator path returns earlier) and Cmd+V pastes are unaffected. The helper is renamed from committedPreeditTextAction to committedTextAction since it no longer only handles preedit commits.
mitchellh
approved these changes
Aug 15, 2026
mitchellh
added a commit
that referenced
this pull request
Aug 24, 2026
Discussion #13979 Dropped paths and text once again honor bracketed paste mode. IME, dictation, emoji picker, and character viewer commits remain typed input. sendText calls ghostty_surface_text, which applies the clipboard paste pipeline and bracketed paste framing when enabled. Separating the paths at the drag-and-drop caller preserves the input-method behavior introduced by #13817.
pull Bot
pushed a commit
to cianfox/ghostty
that referenced
this pull request
Aug 24, 2026
Discussion ghostty-org#13979 Dropped paths and text once again honor bracketed paste mode. IME, dictation, emoji picker, and character viewer commits remain typed input. sendText calls ghostty_surface_text, which applies the clipboard paste pipeline and bracketed paste framing when enabled. Separating the paths at the drag-and-drop caller preserves the input-method behavior introduced by ghostty-org#13817.
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.
Partially addresses #13796. Extends #13222.
Previously,
insertTextcommits without marked text were delivered viasendText, which applies paste semantics and wraps the text in bracketedpaste when the program enables it. macOS dictation and other input
methods often commit without marked text, so programs treated dictated
text as a paste: opencode collapsed it into a
"[Pasted ~N lines]"chipand Neovim applied paste-mode handling.
insertTextis only invoked by input methods (IME, dictation, emojipicker, character viewer); real paste operations use a separate path.
Every non-empty commit is now sent as a key event — the same path
already used for preedit commits since #13222 — so input method text
always arrives as typed input.
Typing is unaffected (the accumulator path returns earlier) and Cmd+V
pastes are unaffected.
committedPreeditTextActionis renamed tocommittedTextActionsince it no longer only handles preedit commits.Testing:
arrives inline with no paste handling; emoji picker inserts inline;
Chinese IME composition unchanged; dictation in Neovim normal mode now
behaves as keystrokes, matching Terminal.app.
Notes:
with typed-text semantics). The previous behavior came from the paste
path preserving the newline; a follow-up could deliver it as an
Enter keypress if desired.
AI usage: drafted with OMO + OpenCode + DeepSeek V4 Pro assistance;
reviewed, edited, and manually tested by the author.