EN | ES | FR

Why I Started Using tmux on Linux (And Why I Wish I Had Done It Sooner)

May 12, 2026

terminal tmux

As someone who works heavily from the terminal, SSH sessions, remote machines, and long-running scripts, I eventually reached a point where I got tired of losing work every time a terminal closed, my desktop froze, or my SSH connection dropped.

That is when I finally started using tmux.

At first, tmux looked intimidating. The keyboard shortcuts felt strange, and the idea of a “terminal multiplexer” sounded overly complicated. But after forcing myself to use it for a few days, I realized something:

tmux completely changed the way I work on Linux.

Now I use it constantly on Kubuntu, especially because I often SSH into my machine remotely from my Mac mini or laptop. Even when Plasma freezes or I restart SDDM, my terminal sessions continue running safely in the background.

This article is a practical introduction to tmux from the perspective of a real developer workflow.


What Is tmux?

tmux is a terminal multiplexer.

That basically means:

  • You can create multiple terminal sessions
  • Keep them running in the background
  • Disconnect and reconnect later
  • Split terminals into panes
  • Recover your work after disconnects or crashes

Think of tmux as a persistent workspace for your terminal.


Why tmux Is So Useful

Before tmux:

  • Closing a terminal window killed my processes
  • SSH disconnects interrupted my work
  • Long-running scripts could be lost
  • Reconnecting remotely was frustrating
  • I constantly reopened tabs and commands

After tmux:

  • My sessions stay alive
  • I reconnect instantly
  • Scripts continue running
  • I can organize projects into sessions
  • My workflow feels much more stable

This became especially important after moving more of my development workflow to Linux.


Installing tmux

On Ubuntu or Kubuntu:

sudo apt update
sudo apt install tmux

Starting a tmux Session

The simplest way:

tmux

But I strongly recommend naming sessions:

tmux new -s dev

Example session names:

tmux new -s invox
tmux new -s server
tmux new -s websites
tmux new -s flutter

This makes it much easier to organize your work.


Detaching From a Session

One of the most important tmux concepts is detaching.

This leaves your session running in the background.

Inside tmux:

Press:

Ctrl + b

Release both keys, then press:

d

You will return to your normal shell, but tmux continues running.

This is one of the biggest reasons tmux is so powerful.


Listing tmux Sessions

To see all running sessions:

tmux ls

Example output:

dev: 1 windows (created Mon)
server: 2 windows (created Tue)

Reattaching to a Session

To reconnect:

tmux attach -t dev

Short version:

tmux a -t dev

If there is only one session running:

tmux attach

If tmux Says "No Sessions"

You may see:

error connecting to /tmp/tmux-1000/default

This simply means no tmux sessions are currently running.

Start a new one:

tmux new -s dev

Splitting the Terminal Into Panes

This is another feature I use constantly.

Vertical split

Press:

Ctrl + b
%

Horizontal split

Press:

Ctrl + b
"

Now you can have multiple terminals visible at once.

For example:

  • One pane running logs
  • Another editing code
  • Another running SSH
  • Another monitoring processes

Moving Between Panes

Press:

Ctrl + b

Then use the arrow keys.


Creating Multiple Windows

A tmux session can contain multiple windows.

Create a new window:

Ctrl + b
c

Move between windows:

Ctrl + b
n

Previous window:

Ctrl + b
p

Killing a Session

To close a session completely:

tmux kill-session -t dev

Or simply exit all terminals inside the session.


My Real-World tmux Workflow

This is roughly how I use tmux daily.

Websites session

tmux new -s websites

Panes:

  • Symfony server
  • Tailwind watcher
  • Git commands
  • Logs

Flutter session

tmux new -s flutter

Panes:

  • Flutter run
  • adb logcat
  • Git
  • SSH

Server session

tmux new -s server

Panes:

  • htop
  • deployment scripts
  • Docker logs
  • SSH sessions

This keeps my workflow organized and resilient.


tmux Saved Me Multiple Times

One thing I love about tmux is that it keeps running independently from the graphical desktop.

I have had situations where:

  • KDE Plasma froze
  • SDDM restarted
  • RustDesk disconnected
  • SSH sessions dropped

And yet my tmux sessions survived perfectly.

I simply reconnected and continued working.

That alone made tmux worth learning.


Helpful tmux Tips

Force attach if already connected elsewhere

tmux attach -d -t dev

Useful if you SSH from multiple machines.


Start tmux automatically after SSH

Add this to your ~/.bashrc:

if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then
    tmux attach -t main || tmux new -s main
fi

Now every SSH login automatically restores your session.


Enable mouse support

Edit:

nano ~/.tmux.conf

Add:

set -g mouse on

Reload config:

tmux source-file ~/.tmux.conf

This allows scrolling and pane resizing with the mouse.


Useful tmux Shortcuts Cheat Sheet

Action Shortcut
Detach session Ctrl + b then d
New window Ctrl + b then c
Next window Ctrl + b then n
Previous window Ctrl + b then p
Split vertically Ctrl + b then %
Split horizontally Ctrl + b then "
Switch panes Ctrl + b + arrow keys
List sessions tmux ls
Attach session tmux attach -t sessionname
Kill session tmux kill-session -t sessionname

Final Thoughts

tmux is one of those Linux tools that initially feels unnecessary until you fully understand what it solves.

Once it becomes part of your workflow, it is very difficult to go back.

For developers, sysadmins, remote workers, and anyone using SSH regularly, tmux adds a level of resilience and organization that dramatically improves productivity.

Today, I consider tmux one of the most essential tools in my Linux workflow.

And honestly, I wish I had started using it years ago.