[BUG] OSC terminal color query responses leak into input buffer
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Random strings appear in the input box while Claude is responding:
]11;rgb:1414/1414/1414]11;rgb:1414/1414/1414]10;rgb:e4e4/e4e4/e4e4\
These are OSC escape sequence responses:
- ]11;rgb:... - terminal background color response
- ]10;rgb:... - terminal foreground color response
Once that happens once, when I scroll up it scrolls through input prompts rather than through my chat history. In Ghostty, I can still do shift+scroll to scroll up properly.
What Should Happen?
Color query responses should be captured/suppressed, not appear in user input.
Error Messages/Logs
Steps to Reproduce
Environment:
- Claude Code version: 2.0.56 (native install)
- OS: macOS (26.1)
- Affected terminals: Terminal.app, Ghostty, Cursor integrated terminal
Relevant shell config (~/.zshrc):
# Using zsh with:
eval "$(/opt/homebrew/bin/brew shellenv)"
eval "$(pyenv init -)"
eval "$(zoxide init zsh)"
# Starship disabled during debugging (issue persists without it)
# eval "$(starship init zsh)"
# zsh plugins
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/.fzf.zsh
claude doctor output:
Diagnostics
└ Currently running: native (2.0.56)
└ Path: /Users/austin/.local/bin/claude
└ Invoked: /Users/austin/.local/share/claude/versions/2.0.56
└ Config install method: native
└ Auto-updates: default (true)
└ Search: OK (bundled)
Occurs when resuming longer Claude some sessions, and in the middle of Claude responses. My guess is when a certain colour/process happens that doesn't always happen with short sessions.
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
(worked last week, but unknown if it was a regression in Claude Code or a change in my environment)
Claude Code Version
2.0.56 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS) + Ghostty + Cursor
Additional Information
Could be a change in my environment, but I think it's still a bug in Claude Code as e.g. Codex and other CLI tools have not been affected.
https://github.com/user-attachments/assets/23fb2a85-56bd-4a3f-9d6d-00a639f450ef
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗