[BUG] macOS text replacements delete words instead of substituting them
Description
macOS system text replacements (System Settings > Keyboard > Text Replacements) do not work correctly in Claude Code's input. Instead of replacing the trigger word with the configured substitution, the word is simply deleted and nothing is inserted in its place.
For example, if you have a text replacement configured:
nao→nãotb→também
When typing nao in Claude Code's prompt, the word disappears entirely instead of being replaced with não.
Steps to reproduce
- Configure a macOS text replacement in System Settings > Keyboard > Text Replacements (e.g.,
nao→não) - Open Claude Code in the terminal
- Type the trigger word (e.g.,
nao) followed by a space - Expected: The word is replaced with the configured substitution (
não) - Actual: The word is deleted and nothing appears in its place
Environment
- Platform: macOS (Darwin 25.3.0)
- Claude Code: CLI (terminal)
- Behavior in other apps: Text replacements work correctly in Terminal.app, other terminal emulators, and all other macOS apps
Additional context
This likely relates to how macOS sends text replacements as a "delete original + insert replacement" sequence. The input handler appears to process the delete event but drops the subsequent insert event.
This is particularly impactful for users who type in languages that rely on diacritics (Portuguese, Spanish, French, etc.) and use text replacements as a fast way to type accented words.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗