zellij-org / zellij

A terminal workspace with batteries included

Home Page:https://zellij.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`previous-swap-layout` doesn't work when loading a layout from a file

nando-digital opened this issue · comments

2. Issues with the Zellij UI / behavior / crash

Issue description

previous-swap-layout and next-swap-layout do not work when zellij was started with a layout located in a file. When executing zellij action next-swap-layout inside zellij nothing happens (no error) even though the split direction should change. I noticed this because the ALT [ keybinding didn't work.

Minimal reproduction

  1. Start zellij with zellij --layout default
  2. Open a second pane
  3. Run zellij action next-swap-layout (or ALT ] when using default shortcuts)
  4. Notice how the split direction changed
  5. Run zellij setup --dump-layout default > someFile inside a new terminal
  6. Start zellij again with zellij --layout /path/to/someFile
  7. Open a second pane
  8. Run zellij action next-swap-layout (or ALT ] when using default shortcuts)
  9. Notice how the split direction has not changed

Even though the exact same layout is used the behavior is different.

Other relevant information

It doesn't matter whether the layout is specified in the zellij config or with the --layout argument
I use zellij 0.40.0 on Arch Linux (WM: Hyprland, Terminal: foot)

You'll need to include swap_layouts in the custom layout file for this to work: https://zellij.dev/documentation/swap-layouts

Sorry, I didn't catch that. It might be worth considering a comment in the default layout (when dumped) that the swap layout is not included, it can be quite confusing when the default layout loaded from a file doesn't behave the same as the default layout. I guess I should read the docs more carefully next time. Thanks for the answer!

I agree - the swap layouts are not one of my best ideas. I hope to improve upon them in the future.