zellij
zellij copied to clipboard
fzf preview scrolling doesn't work
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
@tlinford - do we already send the scroll events to panes with mouse-mode on?
@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?
@tlinford - IMO it would be best to implement this ASAP (when you have time ofc)
@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)?
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.
@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.
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.
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?
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?
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.
Cool, so let's go for it.