Skip to content

Multiple sets of word delimiters for double-click selection #7173

Open

Description

Description of the new feature/enhancement

Currently, users can configure a single set of word delimiters (wordDelimiters) to be used for word boundary detection.
Depending on the context users need different sets of word delimiters.

For example (>< marks the double-click selection)

  • selecting a full path Text before >/home/user-name/file< text after
  • selecting a directory Text before /home/>user-name</file text after

Having a possibility to define multiple sets of word delimiters and to dynamically switch between them would support the user in quickly selecting what he intends to.

Proposed technical implementation details

Assuming that multiple sets of word delimiters could be defined then one possibility to provide a dynamic selection would be to use CTRL and ALT to toggle between the sets.
This way a user could double-click for the standard word delimiter selection, ALT-double-click for a set that only breaks on spaces to select full paths and CTRL-double-click to select path elements by using a set that breaks only on slash.

Activity

  1. added
    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.
    on Aug 4, 2020
  2. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Aug 4, 2020
  3. ghost added
    Needs-Tag-FixDoesn't match tag requirements
    on Aug 4, 2020
  4. zadjii-msft commented on Aug 4, 2020

    @zadjii-msft
    Member

    This isn't the craziest request I've heard - I'll tag this up as a part of "mouse bindings" in general. Thanks!

  5. ghost removed
    Needs-Tag-FixDoesn't match tag requirements
    on Aug 4, 2020
  6. KalleOlaviNiemitalo commented on Aug 4, 2020

    @KalleOlaviNiemitalo

    On a related note…
    mintty in Git Bash has asymmetric word delimiters for double-click selection.

    Assuming there is abc:def:ghi:jkl on the screen:

    • If I double-click e, then it selects abc:def.
    • If I double-click g, then it selects abc:def:ghi.
    • If I double-click the colon between f and g, then it selects abc:def:.

    I'm not currently requesting that feature, just wanted to mention it.

  7. DHowett commented on Aug 6, 2020

    @DHowett
    Member

    Huh, that's really interesting. So, we're almost set up for something like this. We followed PuTTY's system of "character classes"[1], which if we exposed would allow users to configure different levels of delimiters. Perhaps the right way to model this is... (open to discussion, I am not making a ruling here 😄)

    [1] a "word" is actually a contiguous region of codepoints in the same class! thanks Carlos Zamora (@carlos-zamora)!

    class characters
    0 space (always its own class)
    1 all other word delimiters
    2 things that might exist in paths
    3 normal characters

    perhaps multiple-click could just be a class delta transition -- double-click is "select codepoints where Δ(class) <= 0", triple-click is "select codepoints where Δ(class) <= 1" and so on.

    This would mean that triple-click would be required to select the classes "[normal characters] + [things that might exist in paths]" where double-click would still select all "[normal characters]"?

    Thoughts? Is this way off-base, undiscoverable, or something?

  8. rbaradari commented on Aug 6, 2020

    @rbaradari
    Author

    As a user I wouldn't mind a double-click vs. triple-click differentiation or even a double-click on an existing selection to expand it. All versions, including the modifiers I proposed, are similarly hard to discover.

    BTW: While reading up on the PuTTY docs I realized that ALT is already connected to rectangular selection and using ALT to toggle word delimiters for double-click selection might be misleading. This leaves only CTRL for this solution.

  9. KalleOlaviNiemitalo commented on Aug 6, 2020

    @KalleOlaviNiemitalo

    I don't think it would be too confusing if Alt+single-click selects a rectangle but Alt+double-click selects words with alternative word boundaries.

    However, if the user has already selected some words and then extends the selection with Alt+Shift+double-click, and the first click makes the selection rectangular but the second click makes it word-based again, then that will look odd.

  10. removed
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Aug 7, 2020
  11. simonratner commented on Aug 15, 2020

    @simonratner

    Triple-click selects a line / paragraph in line-based / flow-based layouts respectively — very common shortcut shared by a lot of software. I think it might be ok if triple-click on a path selected the path instead, and an additional click was required to expand to the rest of the line, but making that behaviour non-surprising would be hard, especially given that multi-click chords rely heavily on muscle memory: you can't exactly "see" the result and just add an extra click. Also, requiring 5 clicks to select a line (with the 4 classes listed above) is silly territory. Perhaps if it auto-skipped through classes that would not change the selection?

    A modifier key is more consistent in any case I think.

    There is also #574, and the possibility of tying smart double-click selection to it (double-click on an identified path/url selects the path instead of a single word, but in all other contexts continues to work as it does today).

  12. phealy commented on Aug 24, 2020

    @phealy

    #3196 would resolve a lot of this ask as well. I suggested there implementing it on a quadruple-click instead of modifying existing behavior or using a modifier, but it could also be a bound action on a modifier key as well.

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

    Area-SettingsIssues related to settings and customizability, for console or terminalIssue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions