Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
admin_grundlagen:tmux [2016/04/01 18:14] stefan_miethke |
admin_grundlagen:tmux [2024/05/26 04:04] (aktuell) ingo_wichmann |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | // tmux ist eine bessere Alternative zu [[screen]] // | + | // [[tmux_en|page in english]] // |
+ | |||
+ | // tmux ist eine Alternative zu [[screen]] // | ||
Mit Hilfe von tmux kann man | Mit Hilfe von tmux kann man | ||
- | * mehrere Shell-Siztungen in einem Shell-Fenster starten | + | * mehrere Shell-Sitzungen in einem Shell-Fenster starten |
* interaktive Shell-Sitzungen im Hintergrund weiterlaufen lassen | * interaktive Shell-Sitzungen im Hintergrund weiterlaufen lassen | ||
* gemeinsam in einer Shell arbeiten | * gemeinsam in einer Shell arbeiten | ||
+ | * Eingaben und Befehle in mehreren Shells gleichzeitig absetzen | ||
+ | * //nicht// auf serielle Schnittstellen zugreifen (Dafür gibt es [[https://packages.debian.org/bookworm/tio|tio]]) | ||
+ | ====== tmux Grundlagen ====== | ||
- | | tmux-Sitzung starten | ''tmux'' | | + | ^ Einstieg ^^ |
- | | tmux-Fenster im Überblick | Strg+b w | | + | | tmux-Sitzung starten | ''tmux'' | |
- | | tmux-Sitzungen im Überblick | Strg+b s | | + | | tmux-Sitzung in den Hintergrund schicken | ''Strg+b'' ''d'' | |
- | | tmux nächstes/vorheriges Fenster | Strg+b n, Strg+b p | | + | | tmux-Sitzung in den Vordergrund holen | ''tmux attach'' | |
- | | zum 4. Fenster springen | Strg+b 4 ([0..9]) | | + | | shell beenden | ''Strg+d'' | |
- | | tmux-Sitzung vertikal splitten | Strg+b % | | + | ^ Sitzungen (sessions) ^^ |
- | | tmux-Sitzung horizontal splitten | Strg+b " | | + | | Benannte Sitzung ''sitzung1'' starten | ''tmux new -s sitzung1'' | |
- | | tmux Fensterfokus wechseln | Strg+b <Cursor> | | + | | Sitzungen auflisten | ''tmux list-sessions'' | |
- | | tmux Fenstergröße ändern | Strg+b Strg+<Cursor> | | + | | mit laufender Sitzung ''sitzung1'' verbinden | ''tmux attach -t sitzung1'' | |
- | | ::: | Strg+b <esc> <Cursor> | | + | ^ Fenster (windows) ^^ |
- | | tmux Teilfenster Vollbild und zurück (Zoom) | Strg+b z | | + | | Neues tmux-"Fenster" | ''Strg+b'' ''c'' | |
- | | tmux-Sitzung in den Hintergrund schicken | Strg+b d | | + | | zum nächsten Fenster wechseln | ''Strg+b'' ''n'' | |
- | | tmux-Sitzung in den Vordergrund holen | ''tmux attach'' | | + | | zum vorherigen Fenster wechseln | ''Strg+b'' ''p'' | |
- | | tmux-Sitzung gemeinsam nutzen | ''tmux attach'' | | + | | Aktuelles Fenster benennen | ''Strg+b'' '','' | |
- | + | | Fenster auflisten | ''Strg+b'' ''w'' | | |
- | | tmux Scrolling | Strg+[ | | + | | zum 4. Fenster springen | ''Strg+b'' ''4'' ([0..9]) | |
- | | ausschalten | Strg+C | | + | ^ Terminal aufteilen (panes) ^^ |
- | In tmux wieder "ganz normal" mit Shift+BildAuf scrollen: | + | | Horizontal teilen | ''Strg+b'' ''%%"%%'' | |
+ | | Vertikal teilen | ''Strg+b'' ''%'' | | ||
+ | | zu anderem pane wechseln | ''Strg+b'' ''<Pfeil>'' | | ||
+ | | aktuelles pane entfernen | ''Strg+b'' ''x'' | | ||
+ | | Größe des aktuellen panes ändern | ''Strg+b'' ''Strg+<Pfeil>'' | | ||
+ | | aktuelles pane zu Vollbild und zurück (Zoom) | ''Strg+b'' ''z'' | | ||
+ | | alle panes vertikal gleich groß anordnen | ''Strg+b'' ''Alt+2'' bzw.''Strg+b'' ''ESC'' ''2'' | | ||
+ | | alle panes horizontal gleich groß anordnen | ''Strg+b'' ''Alt+1'' bzw.''Strg+b'' ''ESC'' ''1'' | | ||
+ | ^ scrollen ^^ | ||
+ | | nach oben scrollen | ''Strg+b'' ''Bild auf'' | | ||
+ | | tmux Scrolling einschalten | ''Strg+b ['' | | ||
+ | | tmux Scrolling ausschalten | ''Strg+c'' | | ||
===== Distributed shell ===== | ===== Distributed shell ===== | ||
- | alle Fenster miteinander verbinden | + | Eingabe in alle Fenster leiten: |
- | <file><Strg>+b : | + | * ''<Strg>+b'' |
- | :set synchronized-panes | + | |
- | :set synchronized-panes off | + | |
- | </file> | + | |
+ | :set synchronize-panes | ||
+ | wieder ausschalten: | ||
+ | :set synchronize-panes off | ||
+ | |||
+ | ====== Konfigurationsmöglichkeiten ====== | ||
+ | ===== scrollen ===== | ||
+ | In tmux wieder "ganz normal" mit ''Shift+<BildAuf>'' scrollen: | ||
<file raw /etc/tmux.conf> | <file raw /etc/tmux.conf> | ||
# Xterm scrolling | # Xterm scrolling | ||
Zeile 37: | Zeile 57: | ||
</file> | </file> | ||
- | Strg-A statt Strg-B | + | ===== Mausunterstützung ===== |
- | <file># ^A statt ^B | + | In tmux per Maus scrollen, Panes wechseln, etc.: |
+ | <file raw ~/.tmux.conf> | ||
+ | # mouse support | ||
+ | set -g mouse on | ||
+ | </file> | ||
+ | |||
+ | ===== Reloading tmux config ===== | ||
+ | If you have made changes to your tmux configuration file in the ~/.tmux.conf file, | ||
+ | it shouldn’t be necessary to start the server up again from scratch with kill-server. | ||
+ | Instead, you can prompt the current tmux session to reload the configuration with the source-file command. | ||
+ | |||
+ | This can be done either from within tmux, by pressing Ctrl+B and then : to bring up a command prompt, and typing: | ||
+ | |||
+ | <file> | ||
+ | :source-file ~/.tmux.conf | ||
+ | </file> | ||
+ | |||
+ | Or simply from a shell: | ||
+ | |||
+ | <file> | ||
+ | $ tmux source-file ~/.tmux.conf | ||
+ | </file> | ||
+ | |||
+ | This should apply your changes to the running tmux server without affecting the sessions or windows within them. | ||
+ | |||
+ | ===== vi-like key-bindings für copy-mode ===== | ||
+ | <file> | ||
+ | :setw -g mode-keys vi | ||
+ | </file> | ||
+ | ===== in die Dokumentation kopieren ===== | ||
+ | <file> | ||
+ | :set -s copy-command 'cat >> ~/doku' | ||
+ | </file> | ||
+ | ===== ''Strg+a'' statt ''Strg+b'' ===== | ||
+ | <file> | ||
+ | # Strg+a statt Strg+b | ||
set -g prefix C-a | set -g prefix C-a | ||
unbind-key C-b | unbind-key C-b | ||
bind-key C-a send-prefix | bind-key C-a send-prefix | ||
</file> | </file> | ||
+ | |||
+ | ====== Dokumentation ====== | ||
+ | * https://gist.github.com/MohamedAlaa/2961058 | ||
+ | * http://man.openbsd.org/OpenBSD-current/man1/tmux.1 | ||
+ | * https://github.com/tmuxinator/tmuxinator | ||