Skip to content

Behaviour of click-and-drag text selection depends inconsistently on prior pane and application focus state #4282

Closed

Description

@0xabu

Environment

Windows build number: 10.0.18363.592
Windows Terminal version: 0.8.10091.0

NB: I have copy-on-select enabled, although I suspect it doesn't matter.

Steps to reproduce

  1. Open a tab with one pane.
  2. Remove focus from windows terminal (i.e. focus another app).
  3. Click and drag to select some text in the terminal. Notice that this first click focused the window, but didn't select anything.
  4. Click and drag again to select some text in the terminal. Now the text is selected.

The need for step 4 isn't ideal (other apps don't work this way), but it is reasonably intuitive and easy to recover from. But let's see what happens when we have two panes open and we try to select the "wrong" one:

  1. Open a second pane in the same tab.
  2. Remove focus from the terminal. Notice how one pane stays selected/"focused" even if the window as a whole lacks focus.
  3. Click and drag to select some text in the terminal in the original (deselected) pane. Like the single-pane case, the first click focused the terminal window, but nothing else happened.
  4. Click and drag again in the deselected pane. Still nothing happens.
  5. Get annoyed, single click the pane to focus it, then select the text you wanted.

I've also noticed that, once an unfocused pane has a selection, clicking and dragging in that pane seems to ignore the click point (perhaps it never gets the click event?) and treat the drag as a continuation of the prior selection.

Expected behavior

I should be able to select text by clicking and dragging over it:

  • regardless of the prior focus state of the pane I'm selecting in
  • regardless of the prior focus state of the terminal window
  • regardless of what was previously selected (i.e. a new click-drag should always start a new selection)

Actual behavior

Described above.

The fact that each pane has its own selection (so you can select text concurrently in multiple panes) might be a useful feature, but it seems to cause a lot of strange inconsistencies with text selection and copy/paste.

Activity

  1. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Jan 17, 2020
  2. ghost added
    Needs-Tag-FixDoesn't match tag requirements
    on Jan 17, 2020
  3. DHowett-MSFT commented on Jan 23, 2020

    @DHowett-MSFT
    Contributor

    Yeah, this is definitely something that we should fix. Thanks for the comprehensive report!

    Carlos Zamora (@carlos-zamora) I was talking about the issues with beginning/ending selections on things that are/are not focused, and how we need to comport that with "don't select a single cell when the user brings the terminal window to the front by clicking inside it."

    Can you find the duplicates here?

  4. added
    Needs-AttentionThe core contributors need to come back around and look at this ASAP.
    and removed
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Jan 23, 2020
  5. carlos-zamora commented on Jan 28, 2020

    @carlos-zamora

    #1038 and #1367 are probably related to this. Just connecting a general set of issues related to focus and selection in the terminal control.

  6. added
    Area-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)
    Issue-BugIt either shouldn't be doing this or needs an investigation.
    and removed
    Needs-AttentionThe core contributors need to come back around and look at this ASAP.
    Needs-Tag-FixDoesn't match tag requirements
    on Jan 29, 2020
  7. ghost added
    In-PRThis issue has a related PR
    on Feb 7, 2020
  8. ghost closed this as completedin #4506on Feb 13, 2020
  9. ghost added a commit that references this issue on Feb 13, 2020
    7836da0
  10. ghost removed
    In-PRThis issue has a related PR
    on Feb 13, 2020
  11. ghost added
    Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.
    on Feb 13, 2020
  12. ghost added a commit that references this issue on Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Issue-BugIt either shouldn't be doing this or needs an investigation.Priority-3A description (P3)Product-TerminalThe new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions