Open JonnyLoughlin opened 1 month ago
Can you just do bind "Alt o" { ToggleFloatingPanes; SwitchToMode "Normal"; }
.
Or equivalently :!zellij action toggle-floating-panes && zellij action switch-mode normal
Can you just do
bind "Alt o" { ToggleFloatingPanes; SwitchToMode "Normal"; }
.Or equivalently
:!zellij action toggle-floating-panes && zellij action switch-mode normal
That works for swapping into floating panes mode but if I'd swap back to Neovim, Zellij wouldn't autolock again. My workaround for now is just adding the following to my zellij config and manually unlocking if I need to when floating panes are toggled on.
locked {
bind "Alt o" { ToggleFloatingPanes; }
}
Thanks for the report and the suggested workaround. This seems to be an inherited limitation in the Zellij API. Aram hasn't cut a Zellij release in a while, but has been hard at work on it. I'll revisit this after the next Zellij release.
FWIW, when opening a floating pane from within [Neo]vim using the companion plugin, zellij.vim, the floating window is opened in "Normal" mode (unlocked). This also has the helpful effect of opening the floating window in Vim's current working directory.
I have this in my Zellij config.kdl
:
shared_except "locked" {
/* Put keybindings here if they conflict with Vim or others. */
...
bind "Alt t" { ToggleFloatingPanes; }
bind "Alt o" { NewPane "Down"; }
bind "Alt v" { NewPane "Right"; }
...
}
and this in my .vimrc
:
" Open floating Zellij pane with `Alt+f`.
execute "set <M-t>=\ef"
noremap <M-t> :ZellijNewPane<CR>
" Open Zellij pane below with `Alt+t`.
execute "set <M-o>=\et"
noremap <M-o> :ZellijNewPaneSplit<CR>
" Open Zellij pane to the right with `Alt+v`.
execute "set <M-v>=\ev"
noremap <M-v> :ZellijNewPaneVSplit<CR>
These configs result in the desired behavior, when using [Neo]vim at least.
zellij --version:
zellij 0.41.0
Terminal version:
foot version: 1.18.1 +pgo +ime +graphemes -assertions
Operating system:
Linux 6.10.10-arch1-1 #1 SMP PREEMPT_DYNAMIC x86_64 GNU/Linux
Issue description
When toggling floating panes in a window that is locked by a program defined in
triggers
, the ui is not unlocked.Minimal reproduction
Zellij Config:
:!zellij action move-focus-or-tab right
moves focus and unlocks the ui.:!zellij action toggle-floating-panes
opens the floating pane but the ui is still locked.Other relevant information
Thanks for the work on this! I tried taking a swing at getting this fixed but its been a few years since I've even touched Rust and I've never done much with it. Maybe I am not correctly configuring for this use case so any help would be great!