claude-code - 💡(How to fix) Fix [BUG] macOS text replacements delete words instead of substituting them [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45334Fetched 2026-04-09 08:07:45
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×3closed ×1

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.

Root Cause

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.

RAW_BUFFERClick to expand / collapse

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.

extent analysis

TL;DR

Modify the input handler in Claude Code to properly process the "delete original + insert replacement" sequence sent by macOS for text replacements.

Guidance

  • Investigate how the input handler in Claude Code processes delete and insert events to identify why the insert event is being dropped.
  • Verify that the input handler correctly handles other types of input sequences, such as regular character inserts and deletes.
  • Consider adding a special case to the input handler to explicitly handle the "delete original + insert replacement" sequence sent by macOS for text replacements.
  • Test the modified input handler with various text replacements to ensure it works correctly in all cases.

Example

No code snippet is provided as the issue does not include specific code details.

Notes

The solution may require a deeper understanding of how macOS sends text replacements and how the input handler in Claude Code processes input events. Additionally, the fix may need to be tested on different macOS versions and with various types of text replacements.

Recommendation

Apply workaround: Modify the input handler in Claude Code to properly handle the "delete original + insert replacement" sequence, as this is a specific issue with how Claude Code processes text replacements on macOS.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING