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

Can't select text on first line via mouse #354

Closed
seqizz opened this issue Nov 25, 2020 · 5 comments
Closed

Can't select text on first line via mouse #354

seqizz opened this issue Nov 25, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@seqizz
Copy link
Sponsor

seqizz commented Nov 25, 2020

Describe the bug

If there is something on the scrollback buffer, it's not easy to select text from first line (or even second line) via mouse. Click + drag triggers scroll, even if you don't drag upwards.

Environment (please complete the following information):

  • OS: Linux X11
  • Version: UNKNOWN (master commit eee40f7 from 2 days ago)

To Reproduce

  • Print something long so you have something to scroll up
  • Try to select one word from the first visible line via mouse

Expected behavior

Scroll shouldn't be triggered unless mouse moves upwards

@seqizz seqizz added the bug Something isn't working label Nov 25, 2020
@bew
Copy link
Sponsor Contributor

bew commented Nov 25, 2020

Yes! I also wanted to make an issue for this for some time 😃
And there is the same issue with the last line

Double clicking to select works, but as soon as you have to move the mouse.... the whole viewport scrolls to infinity...

On urxvt for example it scrolls only when the mouse is moved ouside of the window (while clicking)

@wez wez closed this as completed in d837dc4 Feb 28, 2021
@wez wez reopened this Feb 28, 2021
@wez
Copy link
Owner

wez commented Feb 28, 2021

This is a consequence of making the mouse bindings assignable; what's happening is that the mouse move event is being recognized as being within the pane and is then routed to the action that extends the selection based on the mouse position. There is a heuristic to scroll based on how close to the top or bottom the mouse is.

The main problem here is that if the mouse moves when it is outside of the pane, we don't currently know to route the event into the pane.

@seqizz
Copy link
Sponsor Author

seqizz commented Feb 28, 2021

The main problem here is that if the mouse moves when it is outside of the pane, we don't currently know to route the event into the pane.

If I understood correctly, is the following possible?

  • If the selection starts somewhere which is not close to the edge (e.g. first-last 3 lines), current behavior applies.
  • If the selection starts near the edge, move ~5x slower, unless mouse actually moves outside of the pane. Once mouse leaves the pane from the edge, scroll normally.

Of course this will work only if it's possible to detect whether the mouse is still being dragged or not, outside the pane.

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
@seqizz
Copy link
Sponsor Author

seqizz commented Apr 4, 2022

Yup, now works. Thanks @davidrios (+wez)!

@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