Skip to content

Fix inert OSC-8 hyperlinks: bump vendored x/vt to upstream parser fix - #962

Open
anutron wants to merge 1 commit into
masterfrom
argus/fix-hyperlink-vt-bump
Open

Fix inert OSC-8 hyperlinks: bump vendored x/vt to upstream parser fix#962
anutron wants to merge 1 commit into
masterfrom
argus/fix-hyperlink-vt-bump

Conversation

@anutron

@anutron anutron commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Why

OSC-8 terminal hyperlinks (e.g. clickable #960 PR references in Claude Code's status line) are inert everywhere in Argus, including panes that already have the hyperlink-style mapping wired up (UvCellToTcellStyletcell.Style.Url).

Root cause: Argus's vendored github.com/charmbracelet/x/vt (pinned to commit f2fb44ab3145) has a parser bug in vt/osc.go's handleHyperlink — for an OSC-8 sequence that includes an id= param (ESC ] 8 ; id=1vaggxp ; https://... ST, the exact form Claude Code emits), the two OSC data segments are assigned to the wrong struct fields: cell.Link.URL receives the id=... params segment and cell.Link.Params receives the real URL. Every downstream consumer faithfully renders a syntactically valid but useless hyperlink whose href is the literal string "id=1vaggxp" — text displays styled (orange/underlined) but Option/Cmd-click does nothing.

Already fixed upstream: github.com/charmbracelet/x/vt commit 3c30eef5e73e8ad8e1765913b0ca2aeb43d32e4f ("fix(vt): store osc 8 hyperlink params and uri in correct fields (#868)", merged 2026-08-28).

What changed

  • Bumped github.com/charmbracelet/x/vt to the exact upstream fix commit (pinned rather than @latest, to avoid pulling in two extra days of unrelated upstream changes). github.com/charmbracelet/x/ansi moves 0.11.6 → 0.11.7 as a coordinated transitive requirement (confirmed via go mod tidy — the fix itself lives entirely in x/vt).
  • No Argus code changes — the bug lived entirely in the vendored dependency; UvCellToTcellStyle's existing cell.Link.URLStyle.Url(...) mapping was already correct.
  • New regression test TestOSC8HyperlinkWithIDParam_RealWireFormat (internal/tui/terminal/terminalpane_test.go) drives the real x/vt emulator with the actual OSC-8 wire-format bytes Claude Code emits, instead of a hand-built uv.Cell — the exact gap that let this ship with zero test coverage. Verified it fails on the old pinned commit with the predicted swapped values, and passes on the fix.
  • Gotcha note added to context/knowledge/gotchas/pty-terminal.md.
  • OpenSpec change authored and archived within this PR (openspec/specs/terminal-rendering/spec.md gains an "OSC-8 hyperlink rendering" requirement) per this repo's spec-driven-development convention for behavioral fixes.

Out of scope: internal/tui/terminalpane/terminalpane.go (the plugin-view pane) — only exists on an unmerged sibling branch (PR #960); it inherits this fix automatically once merged, since it depends on the same corrected x/vt cell data.

Test plan

  • TestOSC8HyperlinkWithIDParam_RealWireFormat passes on the fix, and was confirmed to fail (with the exact predicted swap) against the old pinned x/vt commit
  • make pre-pr — build/vet/fmt-check/lint-pr all clean; test-cover-gate clean at 88.7% coverage (two pre-existing, unrelated local-only false-fails excluded: hera-worker env-var leakage into internal/agent profile-env tests, and the advisory-only make vuln stdlib-CVE gate that CI itself runs as continue-on-error)

🤖 Generated with Claude Code

Argus's pinned github.com/charmbracelet/x/vt had a parser bug in
handleHyperlink: an OSC-8 sequence with an id= param (the form Claude
Code emits for PR references) swapped Link.URL and Link.Params, so
every hyperlink rendered styled but pointed at "id=..." instead of
the real URL. Fixed upstream in x/vt#868; bump to that exact commit
(x/ansi 0.11.6->0.11.7 comes along as a coordinated requirement).

Adds a regression test that drives the real x/vt emulator with the
actual OSC-8 wire bytes instead of a hand-built cell — the gap that
let this ship untested — plus a gotcha note and an OpenSpec change
(archived in this same PR) documenting the fix.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@anutron
anutron force-pushed the argus/fix-hyperlink-vt-bump branch from 08903f1 to cb693ea Compare August 31, 2026 06:52
@github-actions

Copy link
Copy Markdown

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/drn/argus/internal/tui/terminal 96.95% (ø)

Coverage by file

Changed unit test files

  • github.com/drn/argus/internal/tui/terminal/terminalpane_test.go

anutron added a commit that referenced this pull request Sep 1, 2026
# Conflicts:
#	context/knowledge/index.md
#	openspec/specs/terminal-rendering/spec.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant