[BUG] macOS text replacements delete words instead of substituting them

Resolved 💬 1 comment Opened Apr 8, 2026 by reinaldoon Closed Apr 8, 2026

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:

  • naonão
  • tbtambém

When typing nao in Claude Code's prompt, the word disappears entirely instead of being replaced with não.

Steps to reproduce

  1. Configure a macOS text replacement in System Settings > Keyboard > Text Replacements (e.g., naonão)
  2. Open Claude Code in the terminal
  3. Type the trigger word (e.g., nao) followed by a space
  4. Expected: The word is replaced with the configured substitution (não)
  5. 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.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗