hints: Open links on modifier-click, including in mouse mode - #1863
Closed
aymanbagabas wants to merge 2 commits into
Closed
hints: Open links on modifier-click, including in mouse mode#1863aymanbagabas wants to merge 2 commits into
aymanbagabas wants to merge 2 commits into
Conversation
aymanbagabas
force-pushed
the
hint-click-mouse-mode
branch
from
August 11, 2026 21:33
0424579 to
bd232cb
Compare
aymanbagabas
force-pushed
the
hint-click-mouse-mode
branch
from
August 12, 2026 11:11
bd232cb to
1959b6f
Compare
Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>
aymanbagabas
force-pushed
the
hint-click-mouse-mode
branch
from
August 12, 2026 11:20
1959b6f to
46282f7
Compare
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.
Fixes #1298, reported by @DeflateAwning.
Also reported against a terminal running an altscreen application: cmd+click on a link does nothing, and neither cmd+shift, cmd+ctrl nor cmd+alt opens it either. Three separate defects stack up, and the first one breaks link clicks everywhere, altscreen or not.
WindowEvent::ModifiersChangedonly stored the new modifier state. Hint matching runs inCursorMoved, which returns early unless the pointer crosses a cell boundary, so pressing cmd with the pointer already parked on a link never computed a match:highlighted_hintstayedNoneand the release handler had nothing to activate. The only way to light a link up was to hold cmd and then drag the pointer into a different cell, which is not how anyone clicks a link.ModifiersChangednow recomputes the highlight, guarded on the pointer being inside the text area so a stale grid position cannot produce a phantom match while the pointer sits over the tab strip. This is #1298: that report only names the mouse cursor failing to turn into a pointer until you jiggle the mouse, which is the visible half of the same missing recompute, and the link was equally unclickable at that moment, the reporter just had no way to see it.Second, mouse mode swallowed the click. In an application that enables mouse tracking (neovim, tmux, lazygit) both the press and the release handler took the
mouse_reportpath, and only shift bypassed it, so the click was forwarded to the application and the hint never fired. The hint mods being held is itself the signal that the user is following a link rather than clicking inside the application, so a left click with a hint highlighted now bypasses reporting the same way shift does. Press and release are gated on the same condition, so the application never sees a press without its matching release.Third,
trigger_hyperlinkwas dead code. It bailed out unlesshas_hyperlink_range(), andhyperlink_rangeis initialised toNoneand assigned nothing else anywhere in the tree, so the OSC 8 press path could not fire at all. OSC 8 links already reachhighlighted_hintthroughfind_hyperlink_at_point, which is what draws the hover underline, so the field, its two accessors,trigger_hyperlink,open_hyperlinkand the stale clear block inCursorMovedall go. OSC 8 URIs now open throughexecute_hint_actionlike every other match, which routes to the same default handler;resolve_path_for_openingreturnsNonefor anything carrying a URI scheme, so the URI is handed over untouched and the behaviour after #1816 is preserved.Also in here, the pointer cursor no longer sticks.
update_highlighted_hintsreturns true both when a highlight appears and when one is cleared, and the old code setCursorIcon::Pointeron either, leaving a pointer hovering over plain text until the next cell change. The cursor choice moves intoScreen::mouse_cursor_iconso the two call sites cannot drift apart again.Net -27 lines. This is window event wiring with no headless harness, so the existing suite (181 tests in
rioterm) only proves the absence of a regression, not the fix; the three root causes above are established by reading the paths rather than by an automated check, and the behaviour wants a click test on a real window before this lands.#1864 builds on this one: it shows the hovered link's destination in a pill, and depends on the mouse-mode fix here to avoid advertising a link that a click would never reach.
Release Notes: