Pick OSC 8 hyperlink targets, not just the text on screen #3
Labels
No labels
bug
design
docs
enhancement
good-first-issue
packaging
rendering
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/spoor#3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Offer the OSC 8 hyperlink target as a pick candidate, alongside the regex matches — so a cell
whose text is
詳細はこちらcan still hand over the URL it links to.Why
felis_grid::Cellcarrieslink: Option<NonZeroU16>into the grid's link table(
Grid::hyperlink), andsrc/source.rsread_rowdrops it. No pipe-fed hint tool can do this:tmux-thumbs and tmux-fingers only ever see plain text, so they can only match what is displayed.
docs/research.mdnotes foot resolves overlaps with "OSC-8 wins" — it can, because it is theterminal.
spoorparses the bytes itself, so it is in the same position without being tied to aterminal.
The value is exactly the case a regex cannot reach: the link target is not in the text.
Sketch
source::Cellcarries the link handle;source::screen(or the matcher) resolves it through thegrid's link table.
--preset: presets expand to regexes and share the regexpipeline, while a link is a different kind of candidate. Something like
--links.value= the URI, label drawn the same way.a link probably wins over a regex hit inside it, since it is a fact rather than a guess.
Producer requirement
The producer has to emit the OSC 8 sequences, and the blind-pipe rule applies as always.
Note this is not free from felis today:
felis_grid::ansi::row_ansiemits OSC 8 only whenRowAnsiOptions.linksis set, androw_ansi(the daemon's region path) leaves itNone.Feeding spoor from felis' pipe action would need the felis side to pass the link table.
Related: #2 (cell colours) reads
Cell.stylefrom the same cells this readsCell.linkfrom.