Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse selection favours char on the left #1199

Closed
yangit opened this issue Oct 5, 2021 · 3 comments
Closed

Mouse selection favours char on the left #1199

yangit opened this issue Oct 5, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@yangit
Copy link

yangit commented Oct 5, 2021

What Operating System(s) are you seeing this problem on?

macOS

WezTerm version

20211004-173554-f511f9f5

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

If you want to select text with mouse, characters on the left of the cursor are selected much more easily than that on the right. For example if you'd like to copy Wezterm: Hover your mouse in the middle of "W" and start dragging to the right it will not select "W" at the same time you are going to barely touch "m" and it is already selected.
If you try to select in the opposite direction(right to left) "m" is selected easily even you touch the very edge of it, while "W" is not selected until you hover beyond middle of the letter.

bug

Sorry if there is a configuration parameter about this that I've missed or this is the intended behaviour. Just felt weird and selecting something took longer so I wanted to report.

To Reproduce

Please see the animated gif above.

Configuration

no config

Expected Behavior

Be consistent with either

  1. selecting all chars as soon at the mouse starts to hover over them
  2. be a bit lazy any do not select char until I hover beyond the middle (preferably as that is default chrome behaviour)

Logs

No response

Anything else?

No response

@yangit yangit added the bug Something isn't working label Oct 5, 2021
@bew
Copy link
Sponsor Contributor

bew commented Oct 5, 2021

YES THIS!!!
I see this on all platforms as well and it got me kind of crazy a few times already ^^

I'm in favor of the lazy way, where char selection doesn't happen on drag until the mouse crossed the middle of a char (or some third, based on the drag direction?).

Firefox does it based on the middle of the char, based on the drag direction:

firefox-text-selection-from-middle-char.mp4

Same as chrome it seems from what @yangit says.

@wez
Copy link
Owner

wez commented Oct 6, 2021

the current logic to determine the cell coordinate is here:
https://github.com/wez/wezterm/blob/main/wezterm-gui/src/termwindow/mouseevent.rs#L81-L88
it's disconnected from the logic where the drag is detected or handled, so doing some equivalent to the browser experience requires a bit more effort.

davidrios added a commit to davidrios/wezterm that referenced this issue Apr 1, 2022
* implement mouse press capture between the terminal and UI, so when you
  start selecting text from the terminal the tabs won't activate and
  vice-versa
* selecting from the top and bottom lines won't scroll the viewport
  anymore, it will only scroll if the mouse is moved out of line bounds
* change cell selection so that it behaves like text selection usually
  does in other popular software

refs: wez#1199
refs: wez#1386
refs: wez#354
wez pushed a commit that referenced this issue Apr 4, 2022
* gui: improve mouse text selection
* implement mouse press capture between the terminal and UI, so when you
  start selecting text from the terminal the tabs won't activate and
  vice-versa
* selecting from the top and bottom lines won't scroll the viewport
  anymore, it will only scroll if the mouse is moved out of line bounds
* change cell selection so that it behaves like text selection usually
  does in other popular software

refs: #1199
refs: #1386
refs: #354
@wez wez closed this as completed in 2629e50 Apr 4, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants