claude-code - 💡(How to fix) Fix OSC 8 hyperlinks stripped in statusline output [1 comments, 2 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#45173Fetched 2026-04-09 08:11:35
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
0
Timeline (top)
labeled ×5closed ×1commented ×1cross-referenced ×1

OSC 8 hyperlinks output by a custom statusline command are not clickable when Claude Code runs inside tmux. They work correctly outside tmux. Regular hyperlinks in Claude Code's own output (e.g., PR links, file paths) ARE clickable inside tmux — the issue is specific to the statusline rendering path.

Root Cause

Related issues and root cause analysis

Code Example

#!/bin/bash
# /tmp/statusline-hyperlink-repro.sh
printf '\033]8;;https://github.com\033\\click-me\033]8;;\033\\'

---

{
  "statusLine": {
    "type": "command",
    "command": "bash /tmp/statusline-hyperlink-repro.sh"
  }
}

---

set -g allow-passthrough on
set -ga terminal-features ",xterm-256color:hyperlinks"
RAW_BUFFERClick to expand / collapse

Description

OSC 8 hyperlinks output by a custom statusline command are not clickable when Claude Code runs inside tmux. They work correctly outside tmux. Regular hyperlinks in Claude Code's own output (e.g., PR links, file paths) ARE clickable inside tmux — the issue is specific to the statusline rendering path.

Reproduction

  1. Create a minimal statusline script:
#!/bin/bash
# /tmp/statusline-hyperlink-repro.sh
printf '\033]8;;https://github.com\033\\click-me\033]8;;\033\\'
  1. Configure it in ~/.claude/settings.json:
{
  "statusLine": {
    "type": "command",
    "command": "bash /tmp/statusline-hyperlink-repro.sh"
  }
}
  1. Launch Claude Code inside tmux — the statusline shows click-me but it is not clickable.

  2. Launch Claude Code outside tmuxclick-me is clickable.

  3. Run the script directly in a tmux pane — click-me is clickable.

Test matrix

ContextClickable?
Script run directly in terminal (no tmux)Yes
Script run directly in tmux paneYes
Claude Code statusline (no tmux)Yes
Claude Code statusline (inside tmux)No
Regular hyperlinks in Claude Code output (inside tmux)Yes
With CLAUDE_CODE_NO_FLICKER=1 in tmuxNo (same behavior)

The critical observation: tmux fully supports OSC 8 hyperlinks — they work in regular pane content and in Claude Code's own output. The issue is specific to how the statusline content is rendered through Ink's TUI when running inside tmux.

Related issues and root cause analysis

This appears to be the same underlying issue as:

  • #37216 — detailed root cause analysis showing statusline content bypasses Ink's React component tree
  • #44372 — same bug on Windows
  • #35040 — found that OSC 8 on the last line of multiline output works; first-line breaks it

Per the analysis in #37216: Ink's eraseLines() on each render cycle destroys OSC 8 sequences that were written directly to stdout. Content that flows through the Ink React component tree (like regular output hyperlinks) survives because slice-ansi v8 / @alcalzone/ansi-tokenize v0.3+ support OSC 8 round-tripping. The statusline content bypasses this path.

Attempted fixes (no effect)

set -g allow-passthrough on
set -ga terminal-features ",xterm-256color:hyperlinks"

Also tested with CLAUDE_CODE_NO_FLICKER=1 — no change.

Environment

  • Claude Code: latest (CLI, terminal)
  • Terminal: Kitty
  • tmux 3.6a
  • macOS

extent analysis

TL;DR

The issue can be worked around by modifying the statusline rendering to flow through the Ink React component tree, which supports OSC 8 round-tripping.

Guidance

  • Review the root cause analysis in #37216 to understand how Ink's eraseLines() affects OSC 8 sequences in the statusline.
  • Investigate modifying the statusline command to output OSC 8 hyperlinks in a way that survives Ink's rendering cycle, potentially by using a different approach to writing to stdout.
  • Consider using slice-ansi v8 or @alcalzone/ansi-tokenize v0.3+ to support OSC 8 round-tripping in the statusline rendering path.
  • Test the workaround with different terminal emulators and tmux versions to ensure compatibility.

Example

No code snippet is provided as the issue requires a deeper understanding of the Ink React component tree and the statusline rendering mechanism.

Notes

The issue is specific to the statusline rendering path and does not affect regular hyperlinks in Claude Code's output. The workaround may require modifications to the Claude Code codebase or the statusline command.

Recommendation

Apply workaround: Modify the statusline rendering to flow through the Ink React component tree to support OSC 8 round-tripping, as this approach has been shown to work for regular output hyperlinks.

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