Repository navigation
Select a word on double-click and a line on triple-click; Shift-drag over a mouse program selects - #1475
Draft
nedtwigg wants to merge 4 commits into
Draft
Select a word on double-click and a line on triple-click; Shift-drag over a mouse program selects#1475nedtwigg wants to merge 4 commits into
nedtwigg wants to merge 4 commits into
Conversation
A double-click in a terminal that is not reporting the mouse painted xterm.js's own word selection: a different look from the terminal's selection, and one Cmd+C never copied. The mouse router consumed a press only while the program reported the mouse, so with reporting off every press also reached xterm's SelectionService, which selects on a multi-click (and extends on a Shift-click) by itself. Drags never showed it only because the router swallowed their moves. The router now owns multi-clicks the terminal owns: a double-click selects the token under it (the cells Whole words grows over), a triple-click its logical line, both as the terminal's selection, with the copy editor opening on release as after a drag. A press it owns stops at xterm's screen element when it is a multi-click or a Shift-click, after the linkifier there has seen it, so xterm's selection never sees it and a link's double-click still pins its preview. A double-click on a link or a blank selects nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Off macOS, xterm.js treats a Shift-held press as a forced selection, even while the program reports the mouse. The router left that press to the program, so xterm painted its own selection over a shadowed drag: not the terminal's selection, and not one Cmd+C or Ctrl+C copied. The router now owns a Shift-held primary press over a reporting program off macOS. That gives a Shift-drag the terminal's own selection and copy editor, and keeps every event from the program and from xterm. Whether a gesture's events are kept from xterm is now decided at its press and held until its release. Before, it was worked out again on each event from the store, so a Shift-click's release (and a scrollback press's moves before it became a drag) still reached xterm and the program. That leaves stateRequiresNativeMouseSuppression unused, so it is removed. The sweep for other ways xterm's own selection could win found one more: macOS right-click selected a word (rightClickSelectsWord defaults on there). The terminal now turns that off, and pins Option-click forced selection off too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying mouseterm with
|
| Latest commit: |
f7494b5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://98f4388c.mouseterm.pages.dev |
| Branch Preview URL: | https://issue-85-double-click-select.mouseterm.pages.dev |
Resolve scripts/spec-word-budgets.json by taking the larger budget per spec, then ratchet docs/specs/mouse-and-clipboard.md, since both sides added words. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 31, 2026
Brings in #1487's story-clock fix for the access-log story, which is the one changed Argos snapshot every open PR showed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Select a word on double-click and a line on triple-click
A double-click in a terminal that is not reporting the mouse painted xterm.js's own word selection: a different look from the terminal's selection, and one Cmd+C never copied. The mouse router consumed a press only while the program reported the mouse, so with reporting off every press also reached xterm's SelectionService, which selects on a multi-click (and extends on a Shift-click) by itself. Drags never showed it only because the router swallowed their moves.
The router now owns multi-clicks the terminal owns: a double-click selects the token under it (the cells Whole words grows over), a triple-click its logical line, both as the terminal's selection, with the copy editor opening on release as after a drag. A press it owns stops at xterm's screen element when it is a multi-click or a Shift-click, after the linkifier there has seen it, so xterm's selection never sees it and a link's double-click still pins its preview. A double-click on a link or a blank selects nothing.
Take a Shift-drag over a mouse program as the terminal's selection
Off macOS, xterm.js treats a Shift-held press as a forced selection, even while the program reports the mouse. The router left that press to the program, so xterm painted its own selection over a shadowed drag: not the terminal's selection, and not one Cmd+C or Ctrl+C copied.
The router now owns a Shift-held primary press over a reporting program off macOS. That gives a Shift-drag the terminal's own selection and copy editor, and keeps every event from the program and from xterm. Whether a gesture's events are kept from xterm is now decided at its press and held until its release. Before, it was worked out again on each event from the store, so a Shift-click's release (and a scrollback press's moves before it became a drag) still reached xterm and the program. That leaves stateRequiresNativeMouseSuppression unused, so it is removed.
The sweep for other ways xterm's own selection could win found one more: macOS right-click selected a word (rightClickSelectsWord defaults on there). The terminal now turns that off, and pins Option-click forced selection off too.
The Shift-drag behavior on Windows/Linux follows the maintainer's decision. Side effect for review: a Shift-click inside a mouse-reporting program on Windows/Linux no longer reaches the program. macOS is unchanged.
Approve the new Argos snapshot. Main, including #1466 (quote rewrap), is merged in. A double-click on a quoted line still selects just the word; a triple-click covers the whole line, quote prefix included, which Auto writes as Markdown
>as it would for a drag.Fixes #85
🤖 Generated with Claude Code