Terminal GuideTerminal Guide
zellij icon

Zellij

Multiplexers
macOSLinux
Rust

Modern Rust-based terminal multiplexer with intuitive UI and WebAssembly plugins.

Official Website

Features

WebAssembly PluginsFloating PanesSession ManagementBuilt-in Layouts

Installation

Homebrew
brew install zellij
Pacman (Arch)
pacman -S zellij
Cargo (Rust)
cargo install zellij

Why 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

Basic Commands
# 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 d

Session Management

Creating, Listing, and Switching Sessions

Session Management
# 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

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 session

Window and Pane Operations

Tab 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 Enter

Pane Operations (Screen Splitting)

Pane Operations
# 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 pane

Resize Mode

Resize
# 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 Enter

Key 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 SwitchKeyDescription
ModeCtrl + pPane mode
Ctrl + tTab mode
Ctrl + nResize mode
Ctrl + hMove mode
Ctrl + sScroll mode
Ctrl + oSession mode
Ctrl + qExit mode
Pane ModenNew pane below
dNew pane to right
xClose pane
fToggle fullscreen
wFloating pane
Tab ModenNew tab
xClose tab
rRename tab
h/lMove between tabs
Session ModedDetach
wSession manager
CommonEsc / EnterReturn 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/.

~/.config/zellij/layouts/dev.kdl
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

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.

~/.config/zellij/config.kdl
// 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

Config Management
# 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.kdl

Tips

  • The status bar at the bottom displays the current mode and available keybindings. Check there first when in doubt.
  • Press Ctrl + p then w to create a floating pane. Useful for temporary work.
  • Use zellij attach -c name to 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 true to restore sessions after restarting Zellij.
  • Migrating from tmux? Add tmux-style keybindings in config. Use Ctrl+a as a prefix.
  • Use --layout compact to start with a minimal UI without status bar.

Comparison with tmux/screen

FeatureZellijtmux/screen
Learning curveGentle (on-screen hints)Steep (need to memorize keybindings)
Default configurationReady to useRequires customization
Operational systemMode-basedPrefix key
Floating panesNative supportNone
PluginsWASM (safe & fast)tmux uses shell scripts
Configuration formatKDL (modern)Proprietary format
PortabilityRequires installationWidely available
Written by Dai AokiPublished: 2026-01-20

Related Articles

Explore More