Zellij in Termux – Split Terminal and Run Multiple Commands

Zellij is a terminal workspace tool that lets you run multiple terminal sessions in one window. You can split the terminal into different panes and work on multiple tasks at the same time. It also supports tabs for keeping different tasks organized. You can resize panes, switch between them, and manage your terminal using keyboard shortcuts. Zellij is a useful tool for making terminal work easier and more organized in Termux.

Here’s what you can do with Zellij in Termux:

  • Create multiple terminal panes.
  • Split the terminal horizontally or vertically.
  • Create and manage tabs.
  • Switch between panes and tabs.
  • Resize terminal panes.
  • Run different commands at the same time.
  • Keep terminal sessions organized.
  • Use keyboard shortcuts for quick navigation.

Install Zellij in Termux

Below is the command to install Zellij in Termux, just copy and run the command in your Termux.

First, update your Termux packages:

pkg update

Now install Zellij:

pkg install zellij

After installation, check the version:

zellij --version

Start Zellij:

zellij

Zellij will open a new terminal workspace.

Navigation & Shortcuts

Zellij uses a Ctrl + p style shortcut system called modes. Some useful shortcuts are:

  • Ctrl + p — Pane mode
  • Ctrl + t — Tab mode
  • Ctrl + n — Resize mode
  • Ctrl + h — Move focus left
  • Ctrl + l — Move focus right
  • Ctrl + j — Move focus down
  • Ctrl + k — Move focus up
  • Ctrl + o — Session mode
  • Ctrl + s — Scroll mode
  • Ctrl + g — Lock mode
  • Ctrl + q — Quit Zellij

In Pane mode:

  • n — Create a new pane
  • d — Split the pane down
  • r — Split the pane right
  • x — Close the current pane
  • f — Toggle fullscreen
  • w — Toggle pane frames

In Tab mode:

  • n — Create a new tab
  • x — Close the current tab
  • h — Move to the previous tab
  • l — Move to the next tab
  • 1, 2, 3… — Switch to a tab by number

You can press Esc to return from a mode.

Usage Commands

You can use the following zellij commands to start sessions, manage existing sessions, and check available options.

Start Zellij:

zellij

Start a new session with a name:

zellij --session mysession

List available sessions:

zellij list-sessions

You can also use:

zellij ls

Attach to an existing session:

zellij attach mysession

Or use:

zellij a mysession

Create a new session:

zellij attach --create mysession

Create a new session in the background:

zellij attach --create-background mysession

Kill a session:

zellij kill-session mysession

Kill all sessions:

zellij kill-all-sessions

List Zellij commands:

zellij --help

Show the installed version:

zellij --version

You can also check the manual:

man zellij

These commands are useful for creating, joining, and managing Zellij sessions from your Termux terminal.

End Note

Zellij is a useful tool for keeping your Termux work organized. You can use panes, tabs, and sessions to run multiple tasks in the same terminal. Try its shortcuts and find the setup that works best for you.

SHARE THIS POST: