kyoheiu / felix

tui file manager with vim-like key mapping
https://kyoheiu.dev/felix/
MIT License
708 stars 24 forks source link

Scroll preview keybinds don't work in kitty #205

Closed crispinb closed 1 year ago

crispinb commented 1 year ago

alt-j/k don't work in kitty for some reason. They're fine in other terminals (wezterm, foot).

Can scroll preview keybinds be changed by the user?

kyoheiu commented 1 year ago

Confirmed. Currently there is no option to change the key-binding. One way is to fork this repo and change run.rs.

Note that even after adding Ctrl + j / k key-binding to scroll the preview, it did not work on kitty. (In other terminals both alt and ctrl modifier work) So if you fork, you'd be better to not use modifier anymore: Keys like Shift + j / k or [, ] would be fine.

What is even weirder is that Ctrl + r works properly in kitty...

Edit: See below

kyoheiu commented 1 year ago

Sorry, I misunderstood the cause: In kitty, felix redraws the entire screen when preview is on to remove the previewed image after moving the cursor. So, the alt + j / k itself works correctly, but the redrawing returns the state to default.

Any way, this issue is not what I intended when I added the redrawing, so I'll fix in the next release.

kyoheiu commented 1 year ago

Fixed by #206, now you can use scrolling in kitty by building from main branch. I want more sophisticated way to deal with the kitty protocol, so please think this as a patch.

crispinb commented 1 year ago

Great, thanks @kyoheiu . I'll keep an eye out on the repo for future releases, but I've tried building from main & it definitely works for now in kitty. Interesting that you have to special-case kitty. Terminals do seem to be a bit of a minefield.

kyoheiu commented 1 year ago

Awesome! Thank you for reporting this. I'll keep this open until the release.

kyoheiu commented 1 year ago

v2.2.8 released. Thank you again!