[BUG] OSC 8 Hyperlinks cause persistent underlining

Resolved 💬 3 comments Opened Feb 6, 2026 by lazamar Closed Feb 16, 2026

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?

When Claude shows the link to a file, everything becomes underlined after that.
The terminal is stuck in underline mode and even after quitting Claude everything remains underlined.

What Should Happen?

Underline setting should have cleared at the end boundary of the link.

Error Messages/Logs

Steps to Reproduce

Using script -q /tmp/output.txt && claude --resume I narrowed it down to a single line containing the OSC 8 hyperlink, which is attached to the issue.
If I cat line_with_osc8.txt I reliably get my terminal stuck with underlines. I have to run reset to remove the underlines.
If I cat line_no_osc8.txt that does not happen.

line_no_osc8.txt
line_with_osc8.txt

My setup:

  • Neovim terminal in iTerm2 (MacOS)
  • Does not happen on iTerm2 directly
  • TERM is xterm-256color (both inside and outside Neovim)

Screenshot:
<img width="1036" height="561" alt="Image" src="https://github.com/user-attachments/assets/953db2ca-0866-4d50-bffa-a9f250f06523" />

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.31 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

My terminal definitely should be handling OSC 8 Hyperlinks better, but debugging this was a bit of a pain, so worth having this documented (at least in this issue) and maybe having a way to disable OSC 8 hyperlinks because right now I don't know how to solve this.

View original on GitHub ↗

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