Mouse selection doesn't work like other apps when mouse cursor is to the left of the text area, to select whole line(s) #10425

Closed
opened 2026-01-31 02:21:13 +00:00 by claunia · 2 comments
Owner

Originally created by @zpostfacto on GitHub (Aug 31, 2020).

I absolutely love love this product, thank you so much guys for making it.

This may be a duplicate of #5099 (I'm not sure), but I wanted to call out one specific behaviour that I find to be especially clearly wrong based on muscle memory from other apps, and also irritating to work around.

Environment

Windows Terminal 1.2.2381.0, installed from the app store, on Windows 10.

Steps to reproduce

OK, I want to select one or more whole lines, including their newline. In almost every other app I have ever used, if you start dragging and then drag while the mouse cursor is to the left of the text area (perhaps even outside the window, which is fine, since the mouse is captured), then the first character on the line will not be included in the selection, since you are to the left of it. In Windows Terminal, it is included, and this seems wrong. It's especially irritating because basically there's no way to get your selection to include that last newline and thus select whole blocks of text with the mouse.

So, steps to reproduce are:

  • Click somewhere and start selecting multiple lines.
  • While dragging, move the mouse far to the left of the first column of text, such as into the margin, or up against the left edge of the monitor.

Expected behavior

I expect the selection to end with a newline character from the last selected line.

Actual behavior

Instead, the first character of the line below is included, like this:

image

(My mouse cursor isn't int he screen cap, but it's to the left of the current window.)

Also, if somebody can point me in the right direction, I could probably fix this and submit a PR. Just need a pointer to where to start poking around.

Originally created by @zpostfacto on GitHub (Aug 31, 2020). I absolutely love love this product, thank you so much guys for making it. This may be a duplicate of #5099 (I'm not sure), but I wanted to call out one specific behaviour that I find to be especially clearly wrong based on muscle memory from other apps, and also irritating to work around. # Environment Windows Terminal 1.2.2381.0, installed from the app store, on Windows 10. # Steps to reproduce OK, I want to select one or more whole lines, including their newline. In almost every other app I have ever used, if you start dragging and then drag while the mouse cursor is to the left of the text area (perhaps even outside the window, which is fine, since the mouse is captured), then the first character on the line will not be included in the selection, since you are to the left of it. In Windows Terminal, it is included, and this seems wrong. It's especially irritating because basically there's no way to get your selection to include that last newline and thus select whole blocks of text with the mouse. So, steps to reproduce are: * Click somewhere and start selecting multiple lines. * While dragging, move the mouse far to the left of the first column of text, such as into the margin, or up against the left edge of the monitor. # Expected behavior I expect the selection to end with a newline character from the last selected line. # Actual behavior Instead, the first character of the line below is included, like this: ![image](https://user-images.githubusercontent.com/3768219/91758315-a5e9e100-eb84-11ea-8e46-a0ba60efe88a.png) (My mouse cursor isn't int he screen cap, but it's to the left of the current window.) Also, if somebody can point me in the right direction, I could probably fix this and submit a PR. Just need a pointer to where to start poking around.
claunia added the Resolution-Duplicate label 2026-01-31 02:21:13 +00:00
Author
Owner

@DHowett commented on GitHub (Sep 3, 2020):

Hey, thanks for the report! You're right about this being a /duplicate of #5099 -- making the selection inclusive on the left and exclusive on the right will resolve this pretty handily (because you'd need to move into the right half of the first cell to select the cell).

There's a branch, if you want to look at some of its historical diffs, where I poked at this for a little bit. It's not pleasant, because changing up our coordinate system never is. https://github.com/microsoft/terminal/tree/dev/duhowett/hax-selection-exclusive

@DHowett commented on GitHub (Sep 3, 2020): Hey, thanks for the report! You're right about this being a /duplicate of #5099 -- making the selection inclusive on the left and exclusive on the right will resolve this pretty handily (because you'd need to move into the right half of the first cell to select the cell). There's a branch, if you want to look at some of its historical diffs, where I poked at this for a little bit. It's not pleasant, because changing up our coordinate system never is. https://github.com/microsoft/terminal/tree/dev/duhowett/hax-selection-exclusive
Author
Owner

@ghost commented on GitHub (Sep 3, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Sep 3, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10425