Skip to content

TerminalView gives embedders no way to define their own double-tap selection #241

Description

@lordspace

TerminalGestureHandler.onDoubleTapDown hardcodes renderTerminal.selectWord(...), and TerminalView exposes no parameter to change it — unlike onSecondaryTapDown / onSecondaryTapUp, which are already passed through.

An embedder that wants a different double-tap meaning (select the whole line, select a URL, open a file) can only correct the word selection afterwards. That has two problems: the word is painted first and replaced a frame later, which the user sees as a flicker; and whether the correction wins depends on scheduling order between the app's gesture layer and xterm's, which is not a contract.

We hit this building a terminal app [https://oterm.net] where Ctrl+double-click selects the whole line. Our first attempt applied the selection from a post-frame callback and was overwritten; the second used a microtask to land in the same frame — which works, but only by relying on dispatch ordering.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions