tmux🔗
tmux is a terminal multiplexer.
Scripting with tmux🔗
Check if running inside a tmux session🔗
If tmux is version 3.2 or newer the environment variable TERM_PROGRAM
is set:
if [ "$TERM_PROGRAM" = tmux ]
then
echo "Inside a tmux session"
else
echo "Outside a tmux session"
fi
send-keys🔗
The command send-keys
has the following syntax:
The target can be shorted as -t ':.!'
, which means:
- last active session
- last active window
- previously selected pane
Usage with new-window
:
Usage with new-session
:
Current special key bindings🔗
- Ctrl+A V - split pane vertically (same directory)
- Ctrl+A H - split pane horizontally (same directory)