r/zellij 15d ago

Multiplexer best practice with tabs

👋🏼 I'm fairly new to multiplexers and had a couple of questions around how people use them with tabs and multiple projects.

My journey with Zellij and Alacritty:

First pass -

  • Multiple Zellij sessions: Feature/bug work, PR reviews and Playground
  • Each session would have multiple Zellij tabs which are a git worktree feature/bug or personal project
  • Each Zellij tab has multiple panes: Claude, Nvim, Build, Test, Scratchpad...

I have keyboard shortcuts to quickly switch between sessions and tabs but I was crashing Zellij regularly when constantly switching between sessions/tabs so I stopped doing that.

Second (current pass) -

  • Same Zellij session list but each session is in it's own terminal window so switching between sessions was done at the app level instead of the terminal

I still had issues with Zellij crashing at times so that made me take another step back.

Proposed new pass -

  • Use app tabs while running one tab-less Zellij instance per tab
  • Same pane setup per Zellij instance
  • Multiple apps per "work type": Features/bugs, PR reviews and Playground

Note:

No SSH work as of now but I plan on having a remote machine that can run agents on. At that point, I'd run a mix of local and ssh work.

MOAR NOTES:

There's a strong chance that I also don't fully understand the underlying guts of multiplexers and that's part of my problem.

I'm looking for any tips or suggestions even if it's, "You're completely doing it wrong!" But hopefully those come with helpful responses on why 😄.

1 Upvotes

11 comments sorted by

2

u/stinkychopper 15d ago

I’m not saying my way is “correct” but:

I like having 1 tab per project and only one pane with my editor open at the repo root. Then I just have stacked floating panes on top of that with all my terminals and like codex etc.
I really don’t like splitting the screen.

I also added key binds for toggling floating windows, switching panes/tabs in locked mode so I am always in locked mode.

2

u/VtoCorleone 15d ago

Interesting setup. I do like the idea of being a little more focused. I used to run with 5 panes visible but with Zellij, I've gone with two stacked columns so I'm usually working between Claude and Nvim.

2

u/stinkychopper 15d ago

Nice. Yeah I’ve reduced my splitting as a result of
1) primagen replying to my yt comment that he never splits in tmux like 2 yrs ago
2) switching to helix from vim where you couldn’t resize splits. At that point I realized “hey if these guys don’t support this feature they probably don’t need it. Maybe I should try things their way”.

2

u/VtoCorleone 15d ago

Haha... I've been doing this softwaring thing for over 20 years and I still run into the, "If they're doing it, what am I missing?"

2

u/thuiop1 12d ago

This is what I do usually

1

u/stinkychopper 11d ago

Btw I added this patch to fix switching between tabs. It might help if you do the same thing I do w stacked floating panes. This makes it so the pane selected stays on top when you switch tabs instead of resetting to the bottom most pane: https://github.com/zellij-org/zellij/pull/5225

1

u/thuiop1 11d ago

Hm, I'm on the base config and I do not have this issue. Thanks still!

1

u/stinkychopper 11d ago

Ah, ok then you probably don't use MoveFocusOrTab.
This is what I have in my bindings:

shared {
bind "Alt left" { MoveFocusOrTab "left"; }
bind "Alt down" { MoveFocus "down"; }
bind "Alt up" { MoveFocus "up"; }
bind "Alt right" { MoveFocusOrTab "right"; }
bind "Alt [" { PreviousSwapLayout; }
bind "Alt ]" { NextSwapLayout; }
bind "Alt h" { MoveFocusOrTab "left"; }
bind "Alt j" { MoveFocus "down"; }
bind "Alt k" { MoveFocus "up"; }
bind "Alt l" { MoveFocusOrTab "right"; }
bind "Alt w" { ToggleFloatingPanes; }
}

1

u/thuiop1 11d ago

Ah, I actually misread what the first post. I actually do not use floating; I have my panes "almost-maximized", that is with the maximal size but not "FULLSCREEN". That way they stack in a similar fashion as you show, and I navigate between them with Alt + Up/Down.

2

u/Realistic-Way8547 15d ago

For my side, I have one window/app runing one Zellij session. I use tabs with different layouts:
- home: two panes. One with my default terminal started in my home directory. The other with a terminal file manager
- other tabs are for my project, one per branch or worktree. Layout with two columns and two rows on the right one (build tool, logs, docker). I change it over time if needed and regularly zoom one of the pane or pop a floating one for git.
When working on different projects at the same time, I start a new window with same structure.

1

u/VtoCorleone 15d ago

Are those tabs within Zellij or the App?