MCPcopy Create free account
hub / github.com/Noumena-Network/code / getHyperlinkAt

Method getHyperlinkAt

src/ink/ink.tsx:1446–1457  ·  view source on GitHub ↗

* Look up the URL at (col, row) in the current front frame. Checks for * an OSC 8 hyperlink first, then falls back to scanning the row for a * plain-text URL (mouse tracking intercepts the terminal's native * Cmd+Click URL detection, so we replicate it). This is a pure lookup * with no s

(col: number, row: number)

Source from the content-addressed store, hash-verified

1444 * the browser-open action via a timer.
1445 */
1446 getHyperlinkAt(col: number, row: number): string | undefined {
1447 if (!this.altScreenActive) return undefined;
1448 const screen = this.frontFrame.screen;
1449 const cell = cellAt(screen, col, row);
1450 let url = cell?.hyperlink;
1451 // SpacerTail cells (right half of wide/CJK/emoji chars) store the
1452 // hyperlink on the head cell at col-1.
1453 if (!url && cell?.width === CellWidth.SpacerTail && col > 0) {
1454 url = cellAt(screen, col - 1, row)?.hyperlink;
1455 }
1456 return url ?? findPlainTextUrlAt(screen, col, row);
1457 }
1458
1459 /**
1460 * Optional callback fired when clicking an OSC 8 hyperlink in fullscreen

Callers 1

handleMouseEventFunction · 0.80

Calls 2

cellAtFunction · 0.85
findPlainTextUrlAtFunction · 0.85

Tested by

no test coverage detected