TmuxApril 20, 2021 | Stack
There are two popular tools for working with screens/sessions in the terminal; Screen and Tmux. Screen is probably to consider the most native and simple of the two. But, this post will be about the Tmux application.
It does not come as native in contrary to Screen, so you have to install it:
sudo apt install tmux
Start a new Tmux session:
After this, all commands to Tmux starts with "Ctrl + b"
Start out by getting a list of all commands:
When creating new sessions, it can be nice to organise them by names instead of the default numerical session names:
tmux new -s session_name
Detach from current session:
List all sessions:
Attach to a session:
tmux a -t [name or number]
To kill panel and in the end the session (if only one panel left):
To kill sessions:
tmux kill-session -t [my-session] or all sessions tmux kill-server
Working with Windows and Panes
Windows are to be considered as workspaces/tabs. Let's say you have a window called "Dev" and another called "Research".
Panes are visible work areas within the windows.
By default a Window (named 0) is created when you create a new session.
Change the name of the current Window:
To create a new Window:
To navigate between Windows:
Ctrl+b [n or p]
At the bottom bar you can see all Windows listed and "*" for the active Window.
Close current Window:
Split current Window horisontally in to Panes:
Navigate between panels:
ctrl+b [and arrows]