Repository navigation
Make web addresses in replies clickable - #179
Merged
Merged
Conversation
Rows written into the scrollback are drawn again over themselves with an OSC 8 hyperlink around each web address, so a Cmd-click opens it even where the terminal does not find addresses itself, or where an address wraps onto the next row. Ratatui drops control characters from text, so the escapes go on the cells after the rows are drawn. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5389110236
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
An address was followed into one next row at most, and into any indented row after an address that happened to end at the edge. The wrap now marks a row that goes on with a word cut in the row above, and the links follow an address through every such row, and no others. An address with a character beyond ASCII, such as `café`, was linked up to that character, so a click opened another page or host. It is now left unlinked. The wrap also gave rows after the first the first row's room, so a wider indent after it pushed them past the edge, where they were cut. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LutDnsMA6fqW8Qwj2Wcoks
This was referenced Oct 27, 2026
Merged
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.
Clicking a web address in Sonny's conversation didn't open it. Sonny printed the address as plain text, so a click worked only if the terminal found the address on its own. That often fails inside a multiplexer pane, and it always fails once an address wraps onto the next row.
Sonny now marks every address it writes into the scrollback as an OSC 8 hyperlink, which terminals open on a click (Cmd-click in Ghostty and iTerm). If an address is cut at the edge of a row, both parts open the whole address. Punctuation that ends the sentence, such as a closing
.,,or), is left out of the link.The dashed underline in the screenshot is how xterm.js draws a hyperlink. In the screenshot, the second address wraps and both of its rows link to the whole address.
How
Ratatui drops control characters from text, so the escapes can't go in a
Span.sonny/src/links.rsinstead reads the rowsinsert_beforejust drew, finds the addresses, and copies those cells with the hyperlink's opening escape on each address's first cell and the closing escape on its last.draw()then writes only those cells again, through the backend, at the rows they now occupy above the viewport. Cells that have already scrolled off the screen are skipped.Rows still in the viewport, such as the line that is streaming, get their links once they are written into the scrollback.
Testing
links.rscover an address within a row and the punctuation trimmed from its end, an address cut across two rows, and text that has no address.cargo test -p sonnypasses (99 + 7), andcargo clippyis clean.scriptin tmux against a scripted reply with two addresses. The raw output has the three expected OSC 8 links, one per row piece, and the screen reads the same as before.terminal-featureshyperlinks. I haven't checked Herdr or Rex.