Skip to content

Make double-click at the edge select across the edge #4009

Closed

Description

@liamness

Environment

Windows build number: 19041.1
Windows Terminal version (if applicable): 0.7.3451.0

Steps to reproduce

  • You may need to configure wordDelimiters to equal " \\()\"',;<>~!@#$^*|+[]{}~│"
  • Open Windows Terminal at default window width, using Ubuntu
  • Run echo 'really long string of text, really particularly long indeed, typing typing typing typing, also this url: https://example.com'
  • Double click on the URL

Expected behavior

The entirety of the URL should be selected.

Actual behavior

Depending on whether you double click on the URL before or after the line wrap, either just https://example or .com is selected.

Activity

  1. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Dec 18, 2019
  2. ghost added
    Needs-Tag-FixDoesn't match tag requirements
    on Dec 18, 2019
  3. added
    Area-OutputRelated to output processing (inserting text into buffer, retrieving buffer text, etc.)
    Area-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)
    Issue-TaskIt's a feature request, but it doesn't really need a major design.
    and removed
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Dec 19, 2019
  4. ghost removed
    Needs-Tag-FixDoesn't match tag requirements
    on Dec 19, 2019
  5. changed the title [-]Double clicking does not select text after line wrap[/-] [+]When ConPTY+Terminal are enlightened about wrapping, make double-click at the edge select across the edge[/+] on Dec 19, 2019
  6. DHowett-MSFT commented on Dec 19, 2019

    @DHowett-MSFT
    Contributor

    This is a nontrivial amount of work because Terminal doesn't exactly know when a word was wrapped. I think we have another task, which would be a prerequisite of this, lying around to fix pty wrapping. Marked appropriately.

  7. vadimkantorov commented on Jul 27, 2020

    @vadimkantorov

    This is especially nasty when some long file path is wrapped, and that's exactly when you want it be selected easily

  8. changed the title [-]When ConPTY+Terminal are enlightened about wrapping, make double-click at the edge select across the edge[/-] [+]Make double-click at the edge select across the edge[/+] on May 1, 2023
  9. zadjii-msft commented on May 1, 2023

    @zadjii-msft
    Member

    Note

    Walkthrough

    I'd start by looking at TextBuffer::_GetWordEndForSelection in textBuffer.cpp. That's the code that should ultimately handle double-click selection. Looks to me like that while loop only iterates over a single row (the result.x < bufferSize.RightInclusive() check). I bet there's a better way to not do that (but also not explode if the user double clicks a word that runs right up to the end of the row in the last row of a totally full buffer).

    Probably possible to write tests in TextBufferTests.cpp, but shockingly, there aren't any selection tests in there..?

  10. jnm27 commented on Jul 8, 2023

    @jnm27
  11. Detzler commented on Oct 9, 2023

    @Detzler
  12. moved this from Walkthrough in issue to Done in Terminal Walkthroughson Dec 15, 2023
  13. added a commit that references this issue on Dec 15, 2023
    63c3573
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-OutputRelated to output processing (inserting text into buffer, retrieving buffer text, etc.)Area-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Help WantedWe encourage anyone to jump in on these.In-PRThis issue has a related PRIssue-TaskIt's a feature request, but it doesn't really need a major design.Needs-Tag-FixDoesn't match tag requirementsProduct-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions