Una layout de ejemplo de Zellij.

Configuring Zellij

An interesting terminal multiplexer

Date:

These days I've been tinkering with some terminal applications, and I stumbled upon Zellij, which is a terminal multiplexer that promises to come with "batteries included". I have to admit it's a good alternative to tmux, but there are some details to keep in mind.

Zellij, like editors such as vim, operates using modes to distribute possible user actions without overloading keyboard shortcuts. This means that upon entering, we'll be in a "normal" mode, and if needed, we must enter another mode to change the position of a window.

One of Zellij's strengths is the ability to configure all keyboard shortcuts to our liking. However, it's crucial to keep in mind that it captures input directly, which can lead to unexpected surprises if the default configuration isn't carefully reviewed. For example, if you have a key combination already set in your vim/neovim, you might accidentally end up invoking one of Zellij's bindings if there's a collision. As in my case, where I have Ctrl+S configured in helix to save changes, it was clashing with Zellij's Ctrl+S to enter its "scroll" mode.

Layouts: Utility with Peculiarities

Zellij's layouts are undoubtedly one of its strong points, offering great flexibility in organizing our workspace. However, there are some details to keep in mind:

  • We can start commands, but to enter a directory, it's better to use the cwd option
  • The commands we can use must not be aliases, these won't be recognized by Zellij (it's not a bug, it's a design decision)
  • Arguments must be passed separated by commas where spaces would usually be.

    json

    pane cwd="~/myserver" command="python" { args "-m" "http.server" "3000" // this works. args "-m http.server 3000" // this doesn't. }

Zellij is a promising tool that offers great flexibility and utility to consider for our terminal.

My Zellij layout