Back openDesk Edu for a sovereign, open-source education â every vote counts.
Vote nowSave products you love by clicking the heart icon.
Essential reference for GNU Nano â keybindings, configuration, search/replace, and common usage for quick text editing.
Eine praktische Anleitung zum Scrollen in tmux-Sessions â besonders beim AusfĂŒhren von tmux innerhalb von tmux. EnthĂ€lt Maus-UnterstĂŒtzung, TastenkĂŒrzel, Copy-Mode und Konfiguration fĂŒr nahtlose Navigation auf mehreren Ebenen.
Geschachteltes tmux ist eine besondere Herausforderung â wenn du tmux innerhalb von tmux ausfĂŒhrst, wird die Scrollback-Behandlung zu einem Kampf zwischen zwei konkurrierenden Terminal-Multiplexern. StandardmĂ€Ăig:
Warum das wichtig ist: Geschachteltes tmux ist nicht nur eine KuriositĂ€t â es ist ein kritischer Workflow fĂŒr:
Ohne korrekte Konfiguration verlierst du den Zugriff auf den Scrollback der inneren Session â genau das, was du beim Debugging oder zur ĂberprĂŒfung von Ausgaben brauchst.
| Bindung | Aktion | Wann verwenden |
|---|---|---|
| Mausrad | Pane direkt scrollen | Standard, funktioniert ĂŒberall |
| Alt+â/â | Zeile fĂŒr Zeile scrollen | Schnelle History-Navigation |
| Alt+PageUp/PageDown | Seite fĂŒr Seite scrollen | Schnelleres BlĂ€ttern |
| Alt+Space | Copy-Mode öffnen | Text auswÀhlen und kopieren |
| Prefix + PgUp/PgDn | tmux copy-mode | Traditioneller tmux-Workflow |
# =============================================================================
# PREFIX-TASTE (von Ctrl+B auf Ctrl+A Àndern)
# =============================================================================
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# =============================================================================
# MAUS-UNTERSTĂTZUNG (empfohlen)
# =============================================================================
set -g mouse on
# Direktes Mausscrollen in Panes
bind-key -n MouseWheelUpPane send-keys -X scroll-up
bind-key -n MouseWheelDownPane send-keys -X scroll-down
# =============================================================================
# ALT-TASTEN SCROLLING (ohne Prefix)
# =============================================================================
bind-key -n M-Up send-keys -X scroll-up
bind-key -n M-Down send-keys -X scroll-down
bind-key -n M-PageUp send-keys -X scroll-up
bind-key -n M-PageDown send-keys -X scroll-down
# Copy-Mode mit Alt+Space öffnen
bind-key -n M-Space copy-mode
# =============================================================================
# VI-STYLE COPY-MODE
# =============================================================================
set-window-option -g mode-keys vi
# Copy-Mode Navigation
bind-key v copy-mode
bind-key -T copy-mode-vi k send-keys -X cursor-up
bind-key -T copy-mode-vi j send-keys -X cursor-down
bind-key -T copy-mode-vi h send-keys -X cursor-left
bind-key -T copy-mode-vi l send-keys -X cursor-right
bind-key -T copy-mode-vi Space start-selection
bind-key -T copy-mode-vi Enter copy-pipe-and-cancel "xclip -selection clipboard"
# =============================================================================
# GESCHACHTTELTES TMUX HANDLING
# =============================================================================
# Doppelprefix fĂŒr geschachtelte Sessions
set -g prefix2 C-a
# Erweiterte Tasten fĂŒr bessere Scroll-UnterstĂŒtzung
set -g extended-keys on
# =============================================================================
# PANE NAVIGATION (Bonus)
# =============================================================================
bind-key -n M-H select-pane -L
bind-key -n M-J select-pane -D
bind-key -n M-K select-pane -U
bind-key -n M-L select-pane -R
# =============================================================================
# WINDOW NAVIGATION (Bonus)
# =============================================================================
bind-key -n M-Left previous-window
bind-key -n M-Right next-window
# =============================================================================
# ALLGEMEINE EINSTELLUNGEN
# =============================================================================
set -g default-terminal "screen-256color"
set -g history-limit 10000
set -g status-interval 5
# tmux-Konfiguration neu laden
tmux source-file ~/.tmux.conf
# Oder innerhalb von tmux: Prefix + :
# Dann eingeben: source-file ~/.tmux.conf
Sobald im Copy-Mode (via Alt+Space oder Prefix + [):
| Taste | Aktion |
|---|---|
h/j/k/l | Cursor bewegen |
0/$ | Anfang/Ende der Zeile |
w/b | NĂ€chstes/vorheriges Wort |
gg/G | Oben/unten des Puffers |
Space | Auswahl starten |
v | Visuellen Modus umschalten |
Enter | Auswahl kopieren |
q | Copy-Mode beenden |
Inneres tmux: Mausrad oder Alt+â/â
ĂuĂeres tmux: Prefix (C-a) dann Scroll-Tasten
1. Alt+Space (Copy-Mode in innen öffnen)
2. Mit hjkl navigieren
3. Space zur Auswahl
4. Enter zum Kopieren
Prefix + Prefix (C-a C-a) â wechselt nach auĂen
Lösung: Stelle sicher, dass set -g mouse on in der Konfiguration steht
Lösung: set -g escape-time 0 hinzufĂŒgen und sicherstellen, dass Terminal Meta-Tasten unterstĂŒtzt
Lösung: Prefix + Prefix (C-a C-a) verwenden, um Ă€uĂere Session zu erreichen
Lösung: Mit set -g history-limit 10000 erhöhen (oder höher)
Um diese Konfiguration auf mehreren Hosts bereitzustellen:
# ansible/roles/tmux/tasks/main.yml
- name: Deploy tmux configuration
copy:
src: files/tmux.conf
dest: ~/.tmux.conf
owner: "{{ ansible_user_id }}"
mode: '0644'
notify: reload tmux
- name: Ensure tmux is reloaded
command: tmux source-file ~/.tmux.conf
ignore_errors: yes
Nach dem Anwenden der Konfiguration testen mit:
# 1. tmux starten
tmux
# 2. Mausscroll testen (sollte sofort funktionieren)
# 3. Alt+Up/Down testen (scrollt History)
# 4. Alt+Space testen (öffnet Copy-Mode)
# 5. Geschachtelte Session erstellen
tmux
# 6. Geschachteltes Scroll testen (Alt-Tasten funktionieren in innen, C-a C-a fĂŒr auĂen)