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

fzf preview scrolling doesn't work #1605

Closed
jscarrott opened this issue Jul 26, 2022 · 11 comments · Fixed by #1678
Closed

fzf preview scrolling doesn't work #1605

jscarrott opened this issue Jul 26, 2022 · 11 comments · Fixed by #1678

Comments

@jscarrott
Copy link

h.

Basic information

zellij --version: 30
stty size: 53 232
uname -av or ver(Windows): Linux john-work 5.15.0-40-generic #43-Ubuntu SMP Wed Jun 15 12:54:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
terminal: alacritty

Further information
Outside fzf you can use the mouse wheel to scroll a fzf preview window but inside a zellij session this doesn't work
In zellij (not very exciting): https://asciinema.org/a/yJFpRqp0N6YdcPBzr0cOtM1zR

Outside zellij:
https://asciinema.org/a/uW4iYnj98QVLJojt6iCF2t5LK

@imsnif
Copy link
Member

imsnif commented Jul 26, 2022

@tlinford - do we already send the scroll events to panes with mouse-mode on?

@tlinford
Copy link
Contributor

@imsnif, nope, not yet - that part of the code seems to have lagged behind a bit.
Right now it's just hard coded to scroll the active pane up/down instead of checking if mouse_mode is on:
https://github.com/zellij-org/zellij/blob/main/zellij-server/src/screen.rs#L1125-L1128

Can look into this soon, or it could be a nice candidate for good first issue maybe, what do you say?

@imsnif
Copy link
Member

imsnif commented Jul 26, 2022

@tlinford - IMO it would be best to implement this ASAP (when you have time ofc)

@tlinford
Copy link
Contributor

@imsnif my bad, was away and missed that forwarding scroll events is implemented!
did a quick run with fzf and it works alright for me, not sure why it's not working on your end @jscarrott, is other mouse related functionality working properly for you (changing focused pane/active tab, etc)?

@jscarrott
Copy link
Author

jscarrott commented Aug 1, 2022

I can focus panes, click on the tab icons at the top to switch tabs, resize the floating window. On closer inspection, this seems to be a bat issue. Scrolling works in bat outside of zellij but is broken inside zellij. I tried rxvt as well as alacritty and got the same behaviour. As the pager bat is using is less, this might be something to do with less actually.

@jscarrott
Copy link
Author

@tlinford Okay I have some more information, it is an issue with less specifically. For some reason using zellij requires passing --mouse to less to have mouse scrolling but outside zellij it doesn't. I can't think why this would make any difference although if I can find time I'll see if I can dig any further.

@jscarrott
Copy link
Author

Exporting LESS="--mouse" fixes less in zellij, fixes bat in zellij but still no scrolling in fzf. I've also just notices that I can't scroll through the files in fzf either.

@tlinford
Copy link
Contributor

tlinford commented Aug 2, 2022

Okay, I think I understand what's happening. It looks like a lot of terminal emulators implement faux scrolling, where for applications in alternate mode, scroll events get turned into up/down arrow key events.

@imsnif do you think we should implement this?

@imsnif
Copy link
Member

imsnif commented Aug 2, 2022

Okay, I think I understand what's happening. It looks like a lot of terminal emulators implement faux scrolling, where for applications in alternate mode, scroll events get turned into up/down arrow key events.

@imsnif do you think we should implement this?

Interesting find, I remember you mentioning this in the past. What would be the downsides or tradeoffs of us implementing this?

@tlinford
Copy link
Contributor

tlinford commented Aug 2, 2022

Interesting find, I remember you mentioning this in the past. What would be the downsides or tradeoffs of us implementing this?

I can't really see any downsides to this.

@imsnif
Copy link
Member

imsnif commented Aug 2, 2022

Cool, so let's go for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants