Claude Code sets SGR 4 (underline) globally, never clears it — causes visual artifacts in terminals

Resolved 💬 2 comments Opened Apr 11, 2026 by milnet01 Closed May 22, 2026

Description

Claude Code v2.1.101 sets SGR 4 (underline attribute) at the start of its TUI rendering and never sends SGR 24 or SGR 0 to clear it. This causes every character in the Claude Code interface to have the underline attribute set — including box-drawing characters, spaces, and regular text.

Impact

Terminal emulators that render underlines faithfully (positioned below the text baseline) show visible horizontal lines across the entire Claude Code UI — under borders, text, and separators. This makes the interface look broken.

Konsole (KDE) happens to position its underlines at the font's descender line where they overlap with character glyphs and are visually hidden, but this is incidental — the underline data is still on every cell.

Steps to Reproduce

  1. Run claude in any terminal emulator
  2. Enable SGR debug logging or inspect cell attributes
  3. Observe that SGR 4 is set on row 1 col 0 and never cleared
  4. All subsequent characters inherit underline=true

Evidence from debug log

SGR 4 (plain) -> underline=1 row=1 col=0
PRINT U+256D '╭' with underline=1 style=1 row=1 col=0
PRINT U+2500 '─' with underline=1 style=1 row=1 col=1
...
PRINT U+0043 'C' with underline=1 style=1 row=1 col=5   (letter 'C' in "Claude Code")
PRINT U+006C 'l' with underline=1 style=1 row=1 col=6
...

1,318 characters printed with underline=1, zero SGR 24 or SGR 0 events to clear it.

Expected Behavior

Claude Code should send SGR 24 (underline off) or SGR 0 (reset) after drawing elements that intentionally use underline, so that subsequent text does not inherit the underline attribute.

Environment

  • Terminal: Custom Qt6 terminal emulator (also tested in Konsole where underlines are invisible due to positioning but still present in cell data)
  • Claude Code: v2.1.101
  • OS: openSUSE Tumbleweed
  • TERM: xterm-256color

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗