Skip to main content

Research: how do battle-proven terminals make grid text clickable, and which is the right reference for DropTerm?

Date: 2026-12-05 Question: DropTerm should support "clickable" text in the terminal grid — hover a link, see it underlined, click it, something happens (open URL, copy, context menu). iTerm2 was the owner's named example. What are the two mechanisms (OSC 8 semantic hyperlinks vs regex URL detection), how do iTerm2, VTE, WezTerm, kitty, Alacritty and Windows Terminal implement them (storage, hover, click routing, wrapping), what does the Rust/GPUI ecosystem already have, and which of these is the reference implementation DropTerm should copy?

TL;DR​

Copy WezTerm's model, with Zed's resolver as the GPUI-native worked example: OSC 8 first through the carried parser DropTerm already has, regex detection as fallback over the match list DropTerm already computes, hover = underline + pointer cursor driven off one active_hyperlink_id, click = left press-and-release on the same cell opening through the open crate DropTerm already vendors. The decisive fact is that the reference design is not a port but a completion: DropTerm's carried alacritty_terminal already parses OSC 8 into per-cell hyperlink attributes (carried/alacritty-terminal/src/term/cell.rs:153), DropTerm's engine already underlines cells matching an active_hyperlink_id at render time (dropterm/src/core/terminal/engine.rs:4646-4667) — and that field is never set to Some by anything — and DropTerm already scans the visible grid for URL regex matches on every update and throws the result away (engine.rs:4194-4200). Every surveyed terminal converges on the same architecture (per-cell small index or Arc'ed pointer into a pooled id/URI table; hover underline + pointer cursor; click opens with either no modifier (WezTerm, kitty, Alacritty) or Ctrl (GNOME Terminal, Windows Terminal, Zed) and selection always wins over the link), so the choice is about default interaction policy, not architecture. iTerm2 is the UX north star (semantic history: click a path, open it at a line number, run a configured command) and stays in the record for that, but its Objective-C/AppKit code is not a porting reference for a Rust/GPUI grid. Rejected: reusing wezterm's crates (DropTerm already carries the same parser lineage), GPUI's InteractiveText for the grid (it is a styled-text-run primitive; the grid is canvas cells), and plain-click-without-selection-precedence (kitty and WezTerm both special-case press-on-link so a drag starting on a link selects instead of opening).

What DropTerm has today​

  • OSC 8 arrives today, end to end, into the cells. The carried vte copy parses OSC 8 (carried/vte/src/ansi.rs:1438-1464: the b"8" if params.len() > 2 OSC arm builds Hyperlink { id, uri } and calls handler.set_hyperlink(...); the Handler trait method sits at ansi.rs:742). The carried alacritty_terminal copy stores it: Term::set_hyperlink (carried/alacritty-terminal/src/term/mod.rs:2041) writes into the cursor template, and printed cells carry CellExtra { zerowidth, underline_color, image, hyperlink } (carried/.../term/cell.rs:149-153), with the hyperlink itself an Arc<HyperlinkInner> of { id, uri } (cell.rs:44-98) that auto-generates an id suffixed _alacritty when the emitter omits one (cell.rs:85-96). Cell::set_hyperlink / Cell::hyperlink() are the per-cell read/write seam (cell.rs:230-251). This is the same CellExtra spill-over seam the images record shipped through (terminal-images.md, 2026-11-05).
  • The render hook exists and awaits a producer. Terminal::active_hyperlink_id: Option<String> (dropterm/src/core/terminal/engine.rs:847) is initialized None (engine.rs:2010) and read in update()'s cell walk (engine.rs:4087, read at :4646-4667): cells whose cell.hyperlink().id equals the active id gain Flags::UNDERLINE, including the wide-char-spacer neighbor cell check (engine.rs:4651-4663). No code anywhere assigns it Some; grep across dropterm/src finds only the declaration, the init, and the read. The hover producer and the click consumer are the missing halves.
  • URL regex detection runs every update and its results are unused. The engine compiles alacritty's default URL regex verbatim (engine.rs:302-308, the regex copied from alacritty's ui_config.rs:36-39), and update() collects visible_regex_match_iter(&term, &mut self.url_regex_match…) runs through the fork's HintPostProcessor into regex_matches (engine.rs:4194-4200; the processor at engine.rs:4882-4988). Grep finds no consumer of regex_matches or of active_regex_match: Option<Match> (engine.rs:846, init :2009, read :4641-4645) outside the engine itself. The detection half of feature is pre-built and idle.
  • The mouse surface is already wired per-button, per-move, per-release. The terminal frame routes on_mouse_down for Left/Middle/Right, on_mouse_move, on_mouse_up for all three plus on_mouse_up_out, on_scroll, and on_key_down into the pane (dropterm/src/terminal/view.rs:2095-2201). on_press (view.rs:1690) handles mouse-reporting ownership first (a reporting child owns the press unless Shift overrides it; a right press in reporting mode is swallowed so it never opens the context menu over the child's bytes, view.rs:1711-1728), then converts window to pane coordinates and grid cells (view.rs:1738-1740, selection::cell_at at view.rs:1829-1834, viewport_to_point at engine.rs:4725). on_motion (view.rs:1791-1816) today only serves the reporting gesture and drag selection; an unpressed move is free real estate for hover.
  • Open-URL plumbing exists. The open crate 5.3.2 is a dependency (dropterm/Cargo.toml:148) and already opens paths/folders system-side with one warn on refusal (dropterm/src/settings.rs:2408-2419, the images panel's system_open_landed at dropterm/src/app_shell.rs:3776, per the images-panel record).
  • The context menu routes through actions, and right-click is already mode-gated. The menu model (dropterm/src/core/context_menu.rs:1-19) opens on right-click in default mode only (in mouse-reporting mode the right press reaches the child), and every row is an existing perform_action verb, so Copy Link Address / Open Link rows are new model entries, not new plumbing.
  • Docs carry no hyperlink key. Grepping docs/docs/*.md for hyperlink finds only research records; every_config_key_is_documented will demand a docs row for whatever config lands.

Findings​

1. The two mechanisms, from the spec​

Primary source: the OSC 8 gist (egmontkob, fetched 2026-12-05).

  • Semantic hyperlinks (OSC 8): OSC 8 ; params ; URI ST opens, OSC 8 ; ; ST closes. Params are colon-separated key=value; only id is defined. Hyperlinks are "like another cell attribute (like color/bold)": every cell painted after the sequence belongs to the link until it closes. Same URI and same non-empty id group into one link across line breaks (that is the wrapping answer: the emitter or the terminal supplies a stable id, and the terminal underlines "cells with the same URI and the same nonempty id" together on hover). Without an id, terminals improvise: VTE mints a fresh implicit id per sequence, iTerm2 groups adjacent same-URI cells.
  • Defaults the spec asks for: underline on hover mirroring auto-detected URLs; opening via "a deliberate action like Ctrl+click or a right-click menu", not plain clicks; per-scheme openness is each terminal's call; file:// requires a hostname, localhost/empty are local, a foreign hostname must be refused. Caps: VTE and iTerm2 limit URIs to 2083 bytes, VTE caps id at 250 bytes. No feature-detection query exists; hyperlinks are a convenience, never the only route.
  • Heuristic detection: every surveyed terminal also regexes the screen. The knobs: WezTerm hyperlink_rules (regex to URL templates, defaults below), kitty detect_urls (default yes) + open_url_with + url_mappings, Alacritty hints (one default URL regex, hyperlinks: true folds OSC 8 cells into the same hint match), Windows Terminal experimental.detectURLs (default true), GNOME Terminal terminal-screen.cc regexes over VTE's match_check API, iTerm2 cmd-click resolution plus "Open Selection as URL" with scheme guessing.

2. Storage: every terminal is a pool plus a per-cell small reference​

TerminalPer cellPool/tableCaps and GC
WezTermCellAttributes.fat.hyperlink: Option<Arc<Hyperlink>> (spills rare attrs into a heap FatAttributes)none needed; the Arc is the tablenone found
AlacrittyCellExtra.hyperlink: Option<Arc<Hyperlink>>none neededauto id <n>_alacritty for id-less sequences
VTEattr.hyperlink_idx: guint32 on the cell attrRing's GPtrArray *m_hyperlinks of GString* [1..=VTE_HYPERLINK_COUNT_MAX] holding id;uri strings; index 0 = noneVTE_HYPERLINK_URI_LENGTH_MAX / VTE_HYPERLINK_ID_LENGTH_MAX; hover pins an idx "even if the cell is scrolled out"
kittyinteger hyperlink_id (0 = none)HyperLinkPool { array of "id:url" strings, map key->id, adds_since_last_gc }MAX_KEY_LEN 2048, MAX_ID_LEN 256; GC at HYPERLINK_MAX_NUMBER - 1 or 8192 adds; overflow drops the link with a log line
Windows TerminalTextAttribute._hyperlinkId: uint16_t (0 = none)TextBuffer._hyperlinkMap (+ _hyperlinkCustomIdMap for explicitly-assigned ids)_PruneHyperlinks() sweeps ids not referenced by any row
iTerm2legacy_screen_char_t.urlCode: unsigned short — "an index into the URL store"the URL store (id to URI)not pinned (Unverified)

Two designs, one shape: either the cell carries an integer index into a string pool the terminal owns and garbage-collects (VTE, kitty, WT, iTerm2), or it carries an Arc'd pointer to an owned {id, uri} pair (WezTerm, Alacritty). DropTerm's carried alacritty_terminal is the second design, already in tree; no storage work remains. The pool designs exist because C wants small fixed cell structs; Rust's Option<Arc<…>> inside the existing CellExtra spill-over buys the same memory shape for free.

3. Hover: mouse move, hit-test, underline, pointer​

  • WezTerm (wezterm-gui/src/termwindow/mouseevent.rs @ a8bf87e): on move it runs pane.apply_hyperlinks(stable_row..stable_row + 1, &self.config.hyperlink_rules) (the regex rules are applied to the grid as implicit hyperlinks, so detection and storage converge into the same cell attribute), then a FindCurrentLink helper reads cell.attrs().hyperlink().cloned() for the pointed cell. A new link under the cursor means "invalidate and repaint", and the window takes CursorIcon::Pointer. No underline is drawn by the mouse code (hover styling rides the render pass).
  • Alacritty (alacritty/src/input/mod.rs @ e6b67c3): cursor_state() builds hint.should_highlight(point, hyperlink.as_ref()) — the HintMatch knows about the OSC 8 hyperlink under the point — and stores the hovered hint in display().highlighted_hint; movement sets hint_highlight_dirty and set_mouse_cursor(Pointer) over hints. The default Hints config has hyperlinks: true on the default URL hint and HintMouse { enabled: true, mods: default }, so OSC 8 links and regex URLs highlight identically, with no modifier.
  • kitty (kitty/mouse.c @ 3295c7c): handle_move_event calls detect_url when OPT(detect_urls); screen_detect_url merges both sources into screen->current_hyperlink_under_mouse {id, x, y, has_detected_url} where a positive id is an OSC 8 hyperlink and hid < 0 marks a regex-detected URL. The pointer becomes a hand, and link_hover_cleared_by_output clears the hover when new output arrives. Highlight only happens when the current modifiers match a mouse mapping that mentions links (kitty.conf option docs).
  • VTE (src/vte.cc @ 2969788): hover state is m_hyperlink_hover_idx / m_hyperlink_hover_uri (owned by the Ring), updated by hyperlink_hilite_update() from motion; VTE exposes get_hyperlink_at_position (nullptr when m_allow_hyperlink is off or no cell link) and emits hyperlink-hover-uri-changed with a bbox. The widget consumer does the rest.
  • Zed (crates/terminal/src/terminal.rs @ 0b8d056): hover is throttled — schedule_find_hyperlink only re-runs after 5 px of travel or 100 ms (FIND_HYPERLINK_THROTTLE_PX/FIND_HYPERLINK_THROTTLE) — and resolves through find_from_terminal_point into last_content.last_hovered_word. The visual hover (underline in link_text_hover color, pointing-hand cursor, URL tooltip) only engages while the secondary modifier (Cmd/Ctrl) is held (crates/terminal_view/src/terminal_element.rs: the prepaint checks window.modifiers().secondary(cx) before styling).
  • Windows Terminal (ControlInteractivity.cpp @ 74da6b6): hover is _core->SetHoveredCell(...); the core resolves the URI and the control layer underlines and shows it. Docs: detectURLs "will cause URLs to underline on hover and be clickable by pressing Ctrl".
  • iTerm2 (sources/TerminalView/PTYTextView.h @ 987644c): the text view's delegate gets - (BOOL)textViewShowHoverURL:(NSString *)url anchor:(VT100GridWindowedRange)anchor; and a removeUnderline ("underline indicating clickable URL"). The factory doc notes the OSC 8 lookup urlActionForHypertextLinkAtCoord is "cheap enough to run on every mouse move" because it "only reads cell attributes".

4. Click: who opens, with which button and modifiers​

  • WezTerm (default mouse assignments, docs config/mouse.html, fetched 2026-12-05): Single Left Up with NONE or SHIFT is CompleteSelectionOrOpenLinkAtMouseCursor — a plain release opens the hyperlink under the cursor unless a selection just completed. The stronger OpenLinkAtMouseCursor is not bound by default; the docs suggest users add their own CTRL-click binding for it. Selection wins over link by construction.
  • kitty (default mouse maps, kitty/options/definition.py @ 3295c7c): mouse_handle_click selection link prompt on plain left click ungrabbed ("Click the link under the mouse or move the cursor"), and click_url on ctrl+shift+left release for the grabbed case. mouse_open_url in mouse.c calls screen_open_url(screen, "open_url") and "Opening a URL must work even when hover highlighting is disabled"; pressing on a link is classified POTENTIAL_DRAG_URL so a press that becomes a drag selects instead of opening. Where the URL goes is open_url_with (default default, i.e. the OS opener after user handlers), with url_mappings rewrites first.
  • GNOME Terminal (src/terminal-screen.cc @ HEAD, fetched 2026-12-05): terminal_screen_capture_click_pressed_cb resolves vte_terminal_check_hyperlink_at (OSC 8) and terminal_screen_check_match (regex) and opens either on button 1 or 2 with GDK_CONTROL_MASK, emitting its match-clicked signal; button 3 gathers the same data for the context menu. Ctrl is required for both kinds, no distinction.
  • Windows Terminal (ControlInteractivity.cpp @ 74da6b6): _getHyperlinkForPointerEvent returns the URI only if (isLeftButton && modifiers.IsCtrlPressed()) — Ctrl+left click — then raises OpenHyperlink for the app layer to launch; a click-count gate ("Handle hyper-link only on the first click to prevent multiple activations") and suppression of the VT mouse release for hyperlink clicks keep the child out of the transaction.
  • Alacritty (alacritty/src/input/mod.rs @ e6b67c3): on mouse release, if let Some(hint) = hint.as_ref().filter(|_| button == MouseButton::Left) { self.ctx.trigger_hint(hint); } — plain left release opens, for both regex hints and OSC 8 links (they are one match type). The keyboard path (Ctrl+Shift+O by default) opens the hint at the vi cursor.
  • Zed (crates/terminal/src/terminal.rs @ 0b8d056): mouse down captures the link only when e.button == MouseButton::Left && e.modifiers.secondary(cx) && self.can_open_links(...); mouse up re-resolves and opens only if the release lands on the same link (mouse_down_hyperlink == mouse_up_hyperlink), then Event::Open fans out to cx.open_url(url) for URLs and to the workspace path-opener for PathLike targets (file paths get existence checks and a working directory; file:// URIs are URL-decoded into PathLike). Secondary-modifier click, down/up same-link semantics.
  • iTerm2 (sources/SemanticHistory/ @ 987644c): cmd-click enters iTermURLActionFactory's four-stage resolution — openableURLAtCoord (sync, scheme-bearing), urlActionForHypertextLinkAtCoord (OSC 8, cell-attribute read), urlActionForPromptAtCoord ("cmd-click tries this before a hyperlink, so a prompt wins over a hyperlink inside it"), and the full async urlActionAtCoord with a iTermSemanticHistoryController: the click can open the file at a line number, run the user's configured command with \1-\5 substitutions (path, line, column, prefix/suffix, working directory), launch a coprocess, or send text; primitives (openURL, launchTaskWithPath, openFile) are overridable, and path reconstruction can brute-force a real path out of surrounding text.

The OSC 8 id param is the spec's answer (same URI + same id underline together across wraps; emitters should use explicit ids in full-screen apps; multiplexers should prefix ids). At the terminal side the wrap problem dissolves if links are cell attributes: nothing per-line exists to break. Zed's resolver demonstrates the cell-attribute expansion loop — from the pointed cell, walk left/right decrementing/incrementing the index and stop when the neighbor's hyperlink() != link (crates/terminal/src/alacritty/hyperlinks.rs @ 0b8d056) — which crosses soft-wrapped rows for free because the grid is linear in cells. VTE stores ids per attr in the Ring's row stream, so a hyperlink spans wrapped rows by construction. DropTerm already carries the one tricky residue: hover matching must reach the wide-char spacer cells that inherit the preceding cell's attributes, which is exactly the WIDE_CHAR_SPACER neighbor check in engine.rs:4651-4663. VTE's auto-id (":%ld", m_hyperlink_auto_id++) uses a leading colon so an implicit id can never collide with an explicit one (src/vteseq.cc @ 2969788); alacritty's _alacritty suffix serves the same purpose (cell.rs:85-96).

6. The Rust/GPUI ecosystem​

  • Zed ships clickable terminal links on the same stack DropTerm uses (gpui + a forked alacritty_terminal; Zed pins its own fork at rev 4c129667ce56611becdc82de6e28218c80e2e88f, root Cargo.toml @ 0b8d056). Its resolver order — OSC 8 cell attribute first, then the URL regex over the line (RegexIter), then configured path regexes — returns HyperlinkMatch { text, is_url, range } (crates/terminal/src/alacritty/hyperlinks.rs), the terminal crate classifies it (Url, or PathLike with cwd + file decoding), and the view layer opens it. Forking alacritty_terminal to add surface behavior is therefore not just accepted practice, it is what Zed does.
  • GPUI at DropTerm's pin has interactive text with link hit regions: InteractiveText (gpui-pre-0.3.12/src/elements/text.rs:1014-1028) wraps a StyledText with clickable_ranges: Vec<Range<usize>>, a click listener gated on down-index and up-index landing in the same range (:1061-1067), a hover listener, and tooltips; its paint pass sets CursorStyle::PointingHand when the pointer is inside a range and resolves characters through text_layout.index_for_position (:1173-1222). It is a text-run primitive: the right tool for DropTerm's chrome (popups, markdown, plugin surfaces), the wrong tool for a canvas-drawn grid whose hit-test is one division by cell size.
  • WezTerm's crates are the parse-and-store reference (not a reuse candidate): wezterm-escape-parser's Hyperlink::parse splits params from URI with the "everything after the params belongs to the URI" rule that survives semicolons inside URLs (wezterm-escape-parser/src/ {osc.rs,hyperlink.rs} @ a8bf87e), the pen carries the hyperlink into every printed cell (term/src/terminalstate/mod.rs: self.pen.set_hyperlink(Some(Arc::new(hyperlink)))), and the config crate defaults hyperlink_rules to six rules — bracket-wrapped URLs (\((\w+://\S+)\) etc. mapping to $1), the generic and closing-parenthesis URL patterns, and an email rule rewritten to mailto:$0 (config/src/config.rs @ a8bf87e). DropTerm's carried stack already holds the same two halves in the same lineage; what DropTerm can copy from WezTerm is the surface: rules-as-config with $0/$N capture templates, rules applied to the grid so implicit links become real cell attributes, and the selection-else-open click default.

7. Shipped-binary corroboration: the installed VTE 0.76.0 decodes to the same architecture (REA MCP, 2026-12-05)​

First-hand instruction-level pass over the Ubuntu runtime library on this machine (/usr/lib/x86_64-linux-gnu/libvte-2.91.so.0.7600.0, package 0.76.0-1ubuntu0.1, sha256 39da50a5bf2ca0a22437d358927986c5e645c248b5d6ddbfbde0f2c4d34e22a2), via REA's digest-bound GNU objdump provider (Evidence ev_58b7f9d1bee1b3ce3d863a6838e4a13623357b63a650d1890d4c15ff92171c64). .symtab is stripped; names come from .dynsym, so all internal addresses below are raw offsets.

  • Click is a pure function: event → URI-or-null. vte_terminal_hyperlink_check_event (@ 0x43cb0) type-checks the widget, converts the event to view coordinates through one shared helper (@ 0x5cdb0, which reads gdk_event_get_event_type/window/button — the same helper serves motion and button events), maps view to grid with round() plus two integer divisions by cell width/height (@ 0x6fd20), gates on the allow-hyperlink flag (Terminal byte 0x3c18, the same byte vte_terminal_set_allow_hyperlink compares at 0x47192), runs the Ring lookup (@ 0x24600), then returns g_strdup(strchr(stored, ';') + 1) — the stored string is id;uri exactly as ring.hh declares, so the library hands back the URI and nothing else: opening stays the app's decision.
  • Storage is the pool the source survey predicted. The Ring lookup (@ 0x24600) bounds-checks the row against the ring window, resolves through a per-row hyperdata map (@ 0x23b20) into an index→object pool (@ 0x23990), treats an empty string as "no link", and a flag variant caches the resolved hyperlink index (Ring+0x9c0) for hover tracking; a cached last-row field (Ring+0x80, reset to −1 by the click path) drives the hover fast path.
  • Hover is row-cache-guarded and ends in a signal. The motion-side function (@ 0x36400) skips the lookup while the row is unchanged (cmp against Ring+0x80 at 0x3643a); on change it re-resolves with the caching flag, splits the URI, stores the hover URI (@ 0x30600), and lands in g_signal_emit + g_object_notify_by_pspec (0x3656f/0x3657e). The hyperlink-hover-uri-changed signal name string sits at 0x71afa with its class-init installation at 0x3b51a.
  • URL detection is the parallel structure on shared seams. vte_terminal_match_check_event (@ 0x43b80) runs the identical coordinate helpers and swaps the Ring lookup for a regex-match lookup (@ 0x2a6e0) — OSC 8 links and regex URLs converge into one hover/underline/click machinery, the same merge kitty's screen_detect_url and Zed's resolver implement in code.

No conflict with the source findings; the shipped artifact confirms the source-derived design point for point. Limitation: no decompiler provider is configured in this environment (Ghidra/Hopper/IDA absent), so this pass is instruction-level reading, not pseudocode.

Recommendation​

Build clickable text as the completion of the OSC 8 path DropTerm's carried stack already parses, with WezTerm as the reference implementation and Zed as the worked example of the same stack under GPUI. In order:

  1. Hover (OSC 8 day one). In on_motion with no pressed button, convert to a grid cell (selection::cell_at + viewport_to_point exist), read cell.hyperlink() with the wide-spacer fallback the render walk already implements, and write the id into active_hyperlink_id — the underline render at engine.rs:4646-4667 lights up unchanged. Clear on leave/output (kitty's link_hover_cleared_by_output is the precedent), point the cursor (gpui CursorStyle::PointingHand on the canvas hitbox, or Zed's throttle at 5 px/100 ms if the per-move cost shows).
  2. Click (OSC 8 day one). Left press records the hovered id; left release opens only if the id is unchanged and no selection drag started (Zed's down/up same-link check; WezTerm's CompleteSelectionOrOpenLink ordering, selection first). Open through open::that_detached for http(s), mailto:, and file:// on the local host — refusing foreign-host file:// per the OSC 8 spec — with the images panel's one-warn refusal shape. Ctrl+click (and Ctrl+Shift for the mouse-reporting case, kitty's grabbed map) always opens, matching Zed/WT/GNOME Terminal, while plain click follows the kitty/WezTerm/Alacritty default DropTerm's shell-first UX sits closer to. Right-click on a link adds Copy Link Address and Open Link rows to the existing context menu (GNOME Terminal's button-3 handler gathers the same link data).
  3. Regex fallback (stage two). Consume regex_matches (engine.rs:4194-4200) as the fallback link source when the cell carries no OSC 8 attribute, in Zed's order (OSC 8 first, then the URL regex). Kitty's model — one resolver returning "hyperlink id or detected URL", a flag telling the click path which kind it opened — is the clean merge. The default regex is already in the engine verbatim from alacritty (engine.rs:302-308).
  4. Config. A hyperlink_rules list modeled on WezTerm's {regex, url} with $0/$N capture templates, defaulted to the bracket/URL/ mailto six, plus an open_url_with-class key when a second opener behavior is wanted. Every key lands in docs/docs/configuration.md per the docs gate.

Rejected, with reasons:

  • iTerm2 as the code reference — its storage (a 16-bit urlCode into a URL store behind AppKit views), mouse handling, and semantic history are Objective-C bound to the NSTextView mouse model; nothing maps onto a GPUI canvas grid. Adopt its UX ambitions (semantic history actions, prompt-wins-over-link precedence, Open Selection as URL) as later stages, not its code.
  • Reusing wezterm's crates (wezterm-escape-parser, wezterm-cell) — DropTerm already carries a parser that parses OSC 8 into the same cell-attribute shape; a second escape-parser stack for one OSC is the resource-audit antipattern. The carry discipline (kit-root-border shape) applies if a fork gap ever appears instead.
  • GPUI InteractiveText for the grid — styled-text-run hit regions with per-character index resolution; the grid has no text runs and its hit-test is cell_at. Use InteractiveText where DropTerm already renders rich text (popups, the plugin declarative surfaces), not here.
  • Plain click with no selection precedence — kitty classifies press on a link as POTENTIAL_DRAG_URL and WezTerm binds CompleteSelectionOrOpenLinkAtMouseCursor precisely because click-to- open must never eat drag selection over a link. Any click design that opens on press, or that lacks the drag escape, is rejected on that precedent.
  • Ctrl-required-only (the GNOME Terminal/WT policy) as the sole path — defensible and it is Zed's choice, but it abandons the drop-down's mouse-first posture; kept only as the mouse-reporting-mode rule (when the child owns the mouse, only a modifier path may steal the click).
  • VTE as a porting source — its pool design is the best storage citation but the code is C++/GTK with the open action deliberately delegated to the widget consumer (vte.cc emits hyperlink-hover-uri-changed and never opens); the behavior to copy from VTE is the id/URI pool with caps and GC, and DropTerm does not need it (Arc'd cells make the pool unnecessary).

Unverified / open questions​

  • iTerm2 internals beyond the headers: hover underline wiring and mouse-down entry inside PTYTextView.m were not line-read (the file is ~12k lines); the click pipeline is cited at the iTermURLActionFactory.h/iTermSemanticHistoryController.h contract level. The modern renderer's hyperlink storage beyond the legacy screen_char_t's absence of a field (the legacy urlCode carries it) was not pinned.
  • kitty: the OSC 8 entry point into get_id_for_hyperlink (in screen.c/screen.h, not fetched) and the value of HYPERLINK_MAX_NUMBER were not pinned; hyperlink.c's pool and mouse.c's merge are the cited halves.
  • Windows Terminal: experimental.detectURLs' detection regex and the hover tooltip UI live in ControlCore/ControlPresenter files not read; "OSC 8 since v1.4" comes from secondary issue references (microsoft/terminal#204 cited by third-party issues), not from release notes.
  • GNOME Terminal hover: VTE emits hyperlink-hover-uri-changed, but the app-level underline-on-hover rendering was not line-read (terminal-screen.cc carries no motion handler; VTE's draw path was not fetched).
  • Alacritty hover-underline styling: display/content.rs shows only the hint-label underline; the highlighted-hint underline lives in display code not line-read. The equivalent DropTerm render hook (engine.rs:4641-4667) is the pinned citation for the behavior.
  • docs.gtk.org's vte4 page for get_hyperlink_at_position returned 404 on the fetch date; VTE API claims cite src/vte.cc instead.
  • WezTerm's hyperlink_rules docs page 404'd (both hyperlink-rules.html and hyperlink_rules.html); the default rules are cited from config/src/config.rs source instead.
  • Whether DropTerm's plain-click policy should extend into mouse-reporting mode at all (kitty keeps a grabbed-only ctrl+shift map; DropTerm's reporting path already owns presses) is an owner ruling the spec stage should take.

Sources​

  • OSC 8 spec: egmontkob's gist — syntax, id semantics, defaults, file:// host rules, 2083/250 caps — https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda (fetched 2026-12-05)
  • WezTerm: wez/wezterm @ main a8bf87e5bcb1135161cb7a86d4e1451ce5c61f38 (2026-12-04): wezterm-cell/src/lib.rs (FatAttributes.hyperlink), wezterm-escape-parser/src/{osc.rs,hyperlink.rs} (Hyperlink::parse), term/src/terminalstate/mod.rs (set_hyperlink onto the pen), wezterm-gui/src/termwindow/mouseevent.rs (apply_hyperlinks, FindCurrentLink, pointer cursor), config/src/config.rs (default_hyperlink_rules); default mouse assignments — https://wezterm.org/config/mouse.html (fetched 2026-12-05)
  • Alacritty: alacritty/alacritty @ master e6b67c3ab1470bc42370d561e63c9e7f1ab549dc (2026-12-03): alacritty/src/input/mod.rs (hint hit-test, highlighted_hint, left-release trigger_hint, should_highlight(point, hyperlink)), alacritty/src/config/ui_config.rs (default hints: URL regex, hyperlinks: true, HintMouse { enabled: true }, Ctrl+Shift+O), alacritty/src/config/bindings.rs (default mouse bindings carry no link action), CHANGELOG.md (OSC 8 support landed in 0.11.0, ;-in- URI fix in 0.12.1) (fetched 2026-12-05)
  • kitty: kovidgoyal/kitty @ master 3295c7cc3190bea8755dd462b51c113d26233cf1 (2026-12-05): kitty/hyperlink.{h,c} (HyperLinkPool, "id:url" keys, MAX_KEY_LEN 2048, MAX_ID_LEN 256, GC at 8192 adds), kitty/mouse.c (detect_url/screen_detect_url merge with hid < 0 for detected URLs, mouse_open_url, POTENTIAL_DRAG_URL, pointer hand, hover cleared by output), kitty/options/definition.py (detect_urls yes, open_url_with default, show_hyperlink_targets never, the mouse_handle_click selection link prompt maps) (fetched 2026-12-05)
  • VTE: GNOME/vte @ main 2969788c460501d9ac8db4506ccc66dbbed47943 (2026-12-04): src/ring.hh (m_hyperlinks GPtrArray of id;uri GStrings, hyperlink_idx_t, hover pinning), src/vteinternal.hh (m_allow_hyperlink, m_hyperlink_hover_idx/uri, m_hyperlink_auto_id), src/vteseq.cc (set_current_hyperlink: id parsing, :%ld implicit ids, length caps), src/vte.cc (hyperlink_check, hover signal, opens nothing itself) (fetched 2026-12-05)
  • VTE shipped binary (REA cross-check, finding 7): Ubuntu libvte-2.91.so.0.7600.0 0.76.0-1ubuntu0.1, sha256 39da50a5bf2ca0a22437d358927986c5e645c248b5d6ddbfbde0f2c4d34e22a2, instruction-level disassembly via REA's objdump provider (Evidence ev_58b7f9d1bee1b3ce3d863a6838e4a13623357b63a650d1890d4c15ff92171c64) (read 2026-12-05)
  • GNOME Terminal: GNOME/gnome-terminal @ HEAD src/terminal-screen.cc (Ctrl+button 1/2 for both OSC 8 and regex matches, match-clicked signal, button 3 gathers link data) — via https://gitlab.gnome.org/GNOME/gnome-terminal/-/raw/HEAD/src/terminal-screen.cc (fetched 2026-12-05)
  • Windows Terminal: microsoft/terminal @ main 74da6b602c25b333e24261e39fc39a3820ddd0d0 (2026-12-05): src/buffer/out/TextAttribute.hpp (_hyperlinkId: uint16_t), src/buffer/out/textBuffer.cpp (_hyperlinkMap, _hyperlinkCustomIdMap, _PruneHyperlinks), src/cascadia/TerminalControl/ControlInteractivity.cpp (SetHoveredCell, Ctrl+left-click OpenHyperlink, single-click gate); interaction settings docs (experimental.detectURLs default true, underline on hover, Ctrl+click) — https://learn.microsoft.com/en-us/windows/terminal/customize-settings/interaction (updated 2026-12-01, fetched 2026-12-05)
  • iTerm2: gnachman/iTerm2 @ master 987644ca28c56648690bf509347c451229d68009 (2026-12-04): sources/ScreenChar/ScreenChar.h (legacy urlCode "index into the URL store"), sources/TerminalView/PTYTextView.h (textViewShowHoverURL:anchor:, removeUnderline, urlActionHelper), sources/SemanticHistory/iTermURLActionFactory.h (the four click-resolution entry points, prompt-wins precedence), sources/SemanticHistory/iTermSemanticHistoryController.h (semantic history dispatch, \1-\5 substitutions) (fetched 2026-12-05)
  • Zed: zed-industries/zed @ main 0b8d056a5f11bb26f25ab3370523102612b20d84 (2026-12-05): crates/terminal/src/terminal.rs (throttled FindHyperlink, process_hyperlink, down/up same-link open, Url vs PathLike), crates/terminal/src/alacritty.rs + alacritty/hyperlinks.rs (OSC 8-first resolver, expand-until-hyperlink-differs, HyperlinkMatch), crates/terminal_view/src/{terminal_view.rs,terminal_element.rs} (Event::Open to cx.open_url, secondary-modifier hover underline + tooltip + pointing hand), root Cargo.toml (alacritty_terminal git fork rev 4c129667) (fetched 2026-12-05)
  • GPUI at DropTerm's pin: gpui-pre-0.3.12 (= zed d2a4fb6ded7c470be25d1541281da3882495b65b, crates.io snapshot), src/elements/text.rs:1014-1028, 1061-1067, 1157-1222 (InteractiveText, clickable ranges, down/up click gating, pointing hand, index_for_position) (local registry checkout, read 2026-12-05)
  • DropTerm local (HEAD, 2026-12-05): dropterm/Cargo.toml:148 (open 5.3.2), root Cargo.toml:40-53 (carried vte/alacritty_terminal path pins), carried/vte/src/ansi.rs:742, 1438-1464, carried/alacritty-terminal/src/term/cell.rs:44-98, 149-153, 230-251, carried/alacritty-terminal/src/term/mod.rs:2041, dropterm/src/core/terminal/engine.rs:302-308, 840-847, 2009-2012, 4087, 4194-4200, 4641-4667, 4725, 4882-4988, dropterm/src/terminal/view.rs:1690-1740, 1791-1836, 2095-2201, dropterm/src/core/context_menu.rs:1-19, dropterm/src/settings.rs:2408-2419, dropterm/src/app_shell.rs:8191