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

Scrolling with mouse wheel in Windows Terminal isn't working unless you hold down Shift while scrolling #99

Closed
mross002 opened this issue Sep 20, 2021 · 3 comments

Comments

@mross002
Copy link

mross002 commented Sep 20, 2021

I'm not sure if this is due to some settings on my machine or what, but when using Yori within Windows Terminal, I'm unable to scroll up or down using the mouse wheel, however, if I hold down the Shift key and then scroll with the mouse wheel then it works, though when scrolling while holding Shift it seems that highlighting, selecting text, ctrl+click, etc. do not work if the text is in an area that is not within the current active area (i.e. not within the area displayed on screen before you scrolled up) - may want to break this behavior out to a separate issue. I do not see this behavior when using cmd or posh within WT, or when running Yori as a stand alone executable, only when running Yori within WT.

Yori version: 1.60
Windows Terminal version: 1.10.2383.0

@malxau
Copy link
Owner

malxau commented Sep 20, 2021

Are you setting YORIQUICKEDIT=1 ?

The basic issue is that mouse events are either handled by Terminal or by Yori (never both.) In conhost, Yori can see the entire history within the window, so it can handle mouse wheel events and move the viewport. In Terminal, this information is not provided, so Yori has no way to respond to mouse wheel events. See microsoft/terminal#10191 and in particular microsoft/terminal#10191 (comment) (the Edit: text at the end.) Holding down Shift tells Terminal to handle the events and not send them to Yori, which is why that works.

The issue about Ctrl+click and selection is related. Because Terminal doesn't let applications see anything that's not part of the current viewport, there's no way for Yori to handle Ctrl+click except for regions that are currently visible (without scrolling.)

Yori gives you the choice about which process should handle the mouse, and realistically if using Terminal, Terminal should handle mouse events. It currently doesn't provide enough support for Yori to handle them well.

@mross002
Copy link
Author

Thanks for your response @malxau - appreciate it - yes I have YORIQUICKEDIT=1, I deleted it and you are correct it resolves the issue with scrolling, but without it the ctrl+click behavior to select values (probably my most used Yori feature) doesn't work at all within WT. So if I'm reading your response correctly and it's one or the other, I will probably keep YORIQUICKEDIT=1 (or only use Yori outside of WT), as the benefits outweigh the reported issue (in my opinion).

Regarding holding down shift to tell Terminals to respond to events and not send them to Yori, are you aware of any way to do the opposite, i.e. have Terminals handle events unless I hold down an additional shortcut key, in which case Yori would handle the events? If so then that would provide the best of both (in my case at least), I'm not married to ctrl being the modifier for selecting values, holding down ctrl+shift as an example when needing to select values with the mouse wouldn't be much of an issue in terms of usability.

@malxau
Copy link
Owner

malxau commented Jan 9, 2022

I'm afraid I don't know of key combinations to have Terminal handle mouse events by default and only send them to applications via a key modifier. You might want to ask the Terminal folks if one exists - I don't see it in their documentation but they may already have it or be open to creating one.

@malxau malxau closed this as completed Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants