Repository navigation
feat(segments): make the repo segment clickable and fix MR notation - #49
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).--hyperlinksand the config key force it either way.Also in here: Claude Code sends
pr.kindand sets it tomrfor GitLab merge requests, which it renders as!123in its own footer since 2.1.234. The segment printed#123for every host.Tests and golangci-lint are clean. Checked the built binary by hand under
TERM_PROGRAM=iTerm.app, underApple_Terminal, and withTMUXset.