Closed JonnyLoughlin closed 1 month ago
Looks good but after looking at the docs, this should be able to be simplified to just use move-focus-or-tab
as it already does the necessary checks. If you'd be willing to make the necessary changes, I'd be happy to merge!
I was basing this off the default Zellij keybindings found here
bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; }
bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; }
bind "Alt j" "Alt Down" { MoveFocus "Down"; }
bind "Alt k" "Alt Up" { MoveFocus "Up"; }
MoveFocusOrTab
also doesn't seem to work properly with Up
and Down
. For example, lets say you have two panes stacked vertically, and an additional tab open. If you do MoveFocusOrTab down
in that top pane, you will move focus to the next tab, not to the pane below.
I actually just tested the following in my Zellij config:;
bind "Alt j" { MoveFocusOrTab "Down"; }
bind "Alt k" { MoveFocusOrTab "Up"; }
These bindings wont actually move up and down between panes. I tried with just two panes stacked on top of each other with no other tabs open and you can't navigate between them with MoveFocusOrTab
.
Not sure if that would be considered a bug in Zellij, but I believe this behavior better matches Zellij.
Sorry about that, after testing your solution is correct. Thank you for your contribution!
Updated the zellij action command to
move-focus-or-tab
to match the behavior in the default and example zellij keybindings.