[PR #4506] Fix click-drag selection on an unfocused Terminal #25800

Open
opened 2026-01-31 09:11:51 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/4506

State: closed
Merged: Yes


Summary of the Pull Request

This PR tries to address some of the weird interactions with pointer pressed events when the Terminal isn't in focus. Here's the four things that have changed as part of this PR;

  1. This PR will allow the user to be able to make a selection with a click-drag without having to first perform a single click on a tab/pane to bring it to focus.
  2. Another weird bug that's fixed in this PR is where trying to make a selection on an unfocused tab when it already has a selection active will simply extend the existing selection instead of making a new one.
  3. Not related to the issue that his PR closes: a right click will now focus the tab/pane.

I've made sure that we still have the existing functionality where a single click on an unfocused tab/pane does not make a single-cell selection and just focuses the tab/pane.

PR Checklist

Validation Steps Performed

Played around with all sorts of selection when in-focus and out of focus with multiple panes and tabs.
Unit tests still pass as well.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/4506 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request This PR tries to address some of the weird interactions with pointer pressed events when the Terminal isn't in focus. Here's the four things that have changed as part of this PR; 1. This PR will allow the user to be able to make a selection with a click-drag without having to first perform a single click on a tab/pane to bring it to focus. 2. Another weird bug that's fixed in this PR is where trying to make a selection on an unfocused tab when it already has a selection active will simply extend the existing selection instead of making a new one. 3. Not related to the issue that his PR closes: a right click will now focus the tab/pane. I've made sure that we still have the existing functionality where a single click on an unfocused tab/pane does not make a single-cell selection and just focuses the tab/pane. ## PR Checklist * [x] Closes #4282 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed ## Validation Steps Performed Played around with all sorts of selection when in-focus and out of focus with multiple panes and tabs. Unit tests still pass as well.
claunia added the pull-request label 2026-01-31 09:11:51 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#25800