[BUG] Stray `m` characters at right edge of streamed response, persist into terminal buffer (tmux/macOS)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
Streamed assistant responses leave stray dim m characters in a vertical column near the right edge of the response area. They appear in the terminal cell buffer (not only the live render), so when I select-and-copy any of the affected output the ms come along and have to be stripped manually.
The artifacts are dim/grey, which is suggestive: they look like the trailing terminator of an \x1b[2m (SGR dim) escape whose \x1b[… prefix was overwritten by a partial-row redraw, leaving the literal m behind in the cell.
This is closely related to a small cluster of TUI rendering bugs but doesn't appear to be a duplicate of any of them:
- #46898 (CLOSED, Windows) — TUI partial redraws skip columns at row edges, leaving ghost characters in the xterm.js buffer. Same root-cause family, but that report was Windows/xterm.js and was closed.
- #53406 — stale background-color artifacts left by floating overlays. Different shape (background cells, not a literal char), but possibly the same partial-clear path.
- #53857 — TUI leaks fragments of current screen into terminal scrollback, with rendering artifacts.
This report is macOS + tmux, the artifact is a visible m character (not just a stale background attribute), and the artifact survives copy-to-clipboard, which together don't match any of the above exactly.
What Should Happen?
Each row touched by a partial redraw should be cleared end-to-end before the new content is written (e.g. \x1b[2K or padding spaces to end-of-row), so no leftover SGR-terminator characters can end up sitting in the terminal cell buffer.
Error Messages/Logs
No error output — pure rendering bug.
Steps to Reproduce
- Run
claudein tmux on macOS, in a wide pane (mine was 191 cols,TERM=tmux-256color). - Ask the assistant for a moderately long response that includes ASCII box-drawing diagrams — boxes with
│,─,←,↓,→etc. (Anything that exercises a colored span next to wide / ambiguous-width Unicode at the right edge of the wrap region seems to do it.) - As the response streams, dim
mcharacters accumulate in a vertical column at the right edge of the response area, at irregular row intervals. - Select-and-copy any region of the response containing one of the affected rows — the
ms are present in the clipboard.
Diagnostics that already rule out the terminal as the source:
$ echo "cols=$COLUMNS term=$TERM"
cols=191 term=tmux-256color
$ tput cols
191
$ stty size
42 191
$ printf '\033[2mdim test\033[0m\n'
dim test # renders correctly dimmed, NO stray "m"
So basic SGR pass-through through tmux is fine; the bug is in Claude Code's redraw output, not in the terminal/multiplexer.
Workaround: Ctrl+L forces a full repaint and clears the artifacts from the visible region (but doesn't undo scrollback that's already been polluted, and they come back as soon as the next streamed response wraps near a colored span).
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.121 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
Terminal: cmux (TERM=tmux-256color), pane width 191 cols, macOS.
Happy to attach a sanitized screenshot on request — the original contained internal/private content so I'm omitting it from the public report.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗