Der TMUX Terminal Multiplexer
Inhalt
Installation
sudo apt install tmux
Aufrufen mit
tmux tmux -2 # 256 Farben erzwingen
Man-Page lesen mit
man tmux
Fenster vertikal und horizontal spalten
Aufspalten des Fensters in oberen und unteren Teil:
C-b " # Alias C-b -
Aufspalten des Fensters in linken und rechten Teil:
C-b % # Alias C-b |
.tmux.conf
Beispiel für eine ~/.tmux.conf Datei (beachte dass Kommando-Präfix damit Strg-Z ist!):
http://hhoegl.informatik.hs-augsburg.de/pub/tmux/_tmux.conf
Nach dem Kopieren muss die Datei noch umbenannt werden in .tmux.conf!
Tmux Session per Skript erstellen
Ein Beispiel:
# tmuxtest.sh (getestet mit tmux rev 3.0a) tmux new-session -d -s s0 -n Win1 tmux new-window -a -t s0:1 -n Win2 tmux select-window -t s0:Win1 tmux split-window -t s0:Win1 -v tmux send-keys -t s0:Win1.0 'w' C-m tmux send-keys -t s0:Win1.1 'ICH=$(whoami)' C-m 'echo Ich bin $ICH' C-m tmux select-window -t s0:Win2 tmux send-keys -t s0:Win2 'cowsay Hallo Leute' C-m tmux select-window -t s0:Win1 tmux select-pane -t s0:Win1.1 tmux send-keys -t s0:Win1.1 'tmux list-panes' C-m tmux -2 attach-session
Dazu eignen sich noch besser die Tools tmuxinator und tmuxp:
Anleitungen im Netz
- Daniel Miessler, Tactical tmux: The 10 Most Important Commands, https://danielmiessler.com/study/tmux/
- https://tmuxguide.readthedocs.io/en/latest/
- Tony Narlock, The Tao of tmux, https://leanpub.com/the-tao-of-tmux/read
- Brian P. Hogan, tmux - Productive Mouse-Free Development, Pragmatic Programmers, https://pragprog.com/titles/bhtmux2/tmux-2
- https://www.hamvocke.com/blog/a-quick-and-easy-guide-to-tmux/
- https://tmuxcheatsheet.com
- Kommandoreferenz und Vergleich von screen und tmux https://hyperpolyglot.org/multiplexers
- Material lokal bei mir http://hhoegl.informatik.hs-augsburg.de/pub/tmux/
- Meine eigene Quickref (mit Inkscape geschrieben/gezeichnet)