Zellij
Modern Rust-based terminal multiplexer with intuitive UI and WebAssembly plugins.
Official WebsiteFeatures
Installation
brew install zellijpacman -S zellijcargo install zellijWhy Use Zellij?
Zellij is a next-generation terminal multiplexer written in Rust. No need to memorize complex keybindings like tmux or screen—intuitive on-screen hints guide your operations. Another major advantage is that it's ready to use right out of the box without configuration.
Intuitive UI
Keybinding hints display at the bottom of the screen. You can figure out how to operate without reading manuals. Beginners can start using it right away.
Fast and Safe (Rust-based)
Written in memory-safe Rust, it's fast and less prone to crashes. Runs stably even during long work sessions.
Layout System
Define pane layouts at startup using KDL format files. Set up optimal layouts for each project.
Plugin System
WebAssembly (WASM)-based plugin system. Extend functionality with file managers, status bars, and more.
Basic Usage
Mode-based Operations
Zellij uses a mode-based operational system. Enter pane mode with Ctrl + p, tab mode with Ctrl + t, etc., then perform operations within each mode. Available keybindings are displayed at the bottom of the screen while in a mode.
Tip: Press Esc or Enter anytime to return to normal mode.
Starting and Exiting Zellij
# Start zellij
zellij
# Start with a session name
zellij -s mysession
# Start with a specific layout
zellij --layout compact
# Exit zellij
# Press Ctrl + q (enter exit mode)
# Then press q to confirm
# Detach from session
# Press Ctrl + o, then dSession Management
Creating, Listing, and Switching Sessions
# Create a new session
zellij -s project1
# List sessions
zellij list-sessions
# or
zellij ls
# Attach to an existing session
zellij attach project1
# or
zellij a project1
# Create if not exists, otherwise attach
zellij attach -c project1
# Kill a session (external)
zellij kill-session project1
# Kill all sessions
zellij kill-all-sessions
# Rename session
# Press Ctrl + o, then r (inside Zellij)Session Manager
# Open session manager inside Zellij
# Press Ctrl + o, then w
# Operations in session manager
# j/k or arrow keys: Select session
# Enter: Attach to selected session
# d: Delete session
# n: Create new sessionWindow and Pane Operations
Tab Operations
# Enter tab mode
# Ctrl + t
# Operations in tab mode:
# n: Create new tab
# x: Close current tab
# r: Rename tab
# h/l or left/right arrow: Move between tabs
# 1-9: Move to tab by number
# Tab: Move to next tab
# Return to normal mode
# Esc or EnterPane Operations (Screen Splitting)
# Enter pane mode
# Ctrl + p
# Operations in pane mode:
# n: Create new pane below
# d: Create new pane to the right
# x: Close current pane
# f: Toggle fullscreen for current pane
# h/j/k/l or arrow keys: Move between panes
# H/J/K/L or Shift+arrow: Resize pane
# e: Swap pane with another position
# Return to normal mode
# Esc or Enter
# Floating pane operations
# Press Ctrl + p then w: Toggle floating pane visibility
# Press Ctrl + p then e: Embed floating paneResize Mode
# Enter resize mode
# Ctrl + n
# Operations in resize mode:
# h/j/k/l or arrow keys: Change size
# +/-: Fine adjustment
# =: Equalize sizes
# Return to normal mode
# Esc or EnterKey Bindings Reference
Zellij uses a mode-based operational system. Perform operations after entering each mode. The current mode and available keybindings are displayed at the bottom of the screen.
| Mode Switch | Key | Description |
|---|---|---|
| Mode | Ctrl + p | Pane mode |
Ctrl + t | Tab mode | |
Ctrl + n | Resize mode | |
Ctrl + h | Move mode | |
Ctrl + s | Scroll mode | |
Ctrl + o | Session mode | |
Ctrl + q | Exit mode | |
| Pane Mode | n | New pane below |
d | New pane to right | |
x | Close pane | |
f | Toggle fullscreen | |
w | Floating pane | |
| Tab Mode | n | New tab |
x | Close tab | |
r | Rename tab | |
h/l | Move between tabs | |
| Session Mode | d | Detach |
w | Session manager | |
| Common | Esc / Enter | Return to normal mode |
Layout Files
Custom Layouts
In Zellij, you can define pane layouts at startup using KDL format layout files. Place layout files in ~/.config/zellij/layouts/.
layout {
// Default tab bar
default_tab_template {
pane size=1 borderless=true {
plugin location="zellij:tab-bar"
}
children
pane size=2 borderless=true {
plugin location="zellij:status-bar"
}
}
// Main tab: editor and terminal
tab name="main" {
pane split_direction="vertical" {
pane name="editor" size="60%" {
command "nvim"
}
pane split_direction="horizontal" {
pane name="terminal"
pane name="logs" {
command "tail"
args "-f" "/var/log/syslog"
}
}
}
}
// Git operations tab
tab name="git" {
pane {
command "lazygit"
}
}
// Server tab
tab name="server" {
pane {
command "npm"
args "run" "dev"
}
}
}Using Layouts
# Start with custom layout
zellij --layout dev
# Start with built-in layout
zellij --layout compact # No status bar
zellij --layout default # Default layout
# See available layouts
ls ~/.config/zellij/layouts/Configuration File
~/.config/zellij/config.kdl
Write Zellij configuration in ~/.config/zellij/config.kdl. Generate a template with zellij setup --dump-config.
// Theme setting
theme "dracula"
// Default shell
default_shell "zsh"
// Default layout
default_layout "compact"
// Mouse mode
mouse_mode true
// Copy behavior
copy_on_select true
copy_command "pbcopy" // macOS
// copy_command "xclip -selection clipboard" // Linux
// Scrollback buffer
scroll_buffer_size 10000
// Pane frames display
pane_frames true
// Mirror session (sync across multiple terminals)
mirror_session false
// Session serialization (restore after restart)
session_serialization true
serialize_pane_viewport true
// Customize keybindings
keybinds {
// Custom binds in normal mode
normal {
// Alt+n to create pane below
bind "Alt n" { NewPane "Down"; }
// Alt+d to create pane to right
bind "Alt d" { NewPane "Right"; }
}
// Add tmux-style prefix key
shared_except "locked" {
bind "Ctrl a" { SwitchToMode "Tmux"; }
}
tmux {
bind "Ctrl a" { Write 1; SwitchToMode "Normal"; }
bind "c" { NewTab; SwitchToMode "Normal"; }
bind "%" { NewPane "Right"; SwitchToMode "Normal"; }
bind """ { NewPane "Down"; SwitchToMode "Normal"; }
bind "d" { Detach; }
}
}
// UI configuration
ui {
pane_frames {
rounded_corners true
}
}Generating and Checking Configuration
# Dump default configuration
zellij setup --dump-config > ~/.config/zellij/config.kdl
# See available themes
zellij setup --dump-themes
# Check configuration directory
zellij setup --check
# Generate layout file
zellij setup --dump-layout default > ~/.config/zellij/layouts/default.kdlTips
- •The status bar at the bottom displays the current mode and available keybindings. Check there first when in doubt.
- •Press
Ctrl + pthenwto create a floating pane. Useful for temporary work. - •Use
zellij attach -c nameto attach if session exists or create if not. Handy to add in shell startup scripts. - •Specify commands in layout files to launch your entire dev environment with one command.
- •Set
session_serialization trueto restore sessions after restarting Zellij. - •Migrating from tmux? Add tmux-style keybindings in config. Use
Ctrl+aas a prefix. - •Use
--layout compactto start with a minimal UI without status bar.
Comparison with tmux/screen
| Feature | Zellij | tmux/screen |
|---|---|---|
| Learning curve | Gentle (on-screen hints) | Steep (need to memorize keybindings) |
| Default configuration | Ready to use | Requires customization |
| Operational system | Mode-based | Prefix key |
| Floating panes | Native support | None |
| Plugins | WASM (safe & fast) | tmux uses shell scripts |
| Configuration format | KDL (modern) | Proprietary format |
| Portability | Requires installation | Widely available |