Skip to content

feat(segments): make the repo segment clickable and fix MR notation - #49

Merged
lexfrei merged 2 commits into
masterfrom
feat/repo-segment-links
Sep 18, 2026
Merged

lexfrei merged 2 commits into
masterfrom
feat/repo-segment-links

Conversation

@lexfrei

@lexfrei lexfrei commented Sep 18, 2026

Copy link
Copy Markdown
Owner

The repo segment names a repository and a PR, and both have a web page. Wrap them in OSC 8 so a click opens them.

There is no way to ask a terminal whether it renders OSC 8, and statusline output is a pipe, not a tty. So hyperlinks = "auto" goes by terminal name and turns links on only where they are known to work. Terminal.app does not make the list, and neither does anything under tmux: Claude Code drops OSC 8 coming from a statusline command there (anthropics/claude-code#23438, closed as not planned). --hyperlinks and the config key force it either way.

Also in here: Claude Code sends pr.kind and sets it to mr for GitLab merge requests, which it renders as !123 in its own footer since 2.1.234. The segment printed #123 for every host.

Tests and golangci-lint are clean. Checked the built binary by hand under TERM_PROGRAM=iTerm.app, under Apple_Terminal, and with TMUX set.

Claude Code sends pr.kind ("mr") next to the number for GitLab merge
requests and prints !123 in its own footer. The repo segment printed
#123 for every host, which is the wrong notation on GitLab.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The repo segment names a repository and a PR that both have a web page.
Wrap both in OSC 8 so a click opens them.

Neither the terminal nor a multiplexer can be asked whether a hyperlink
will render, and statusline output is a pipe rather than a tty, so the
default mode recognizes both by environment variable and the hyperlinks
option overrides that either way.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
@lexfrei
lexfrei marked this pull request as ready for review September 18, 2026 16:47
@lexfrei
lexfrei merged commit 7e9379f into master Sep 18, 2026
5 checks passed
@lexfrei
lexfrei deleted the feat/repo-segment-links branch September 18, 2026 16:47
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