192 shaares
1 result
tagged
tmux
COMMAND
'<>'' represents the shortcut to enter in command mode of tmux. Initialy ctrl+n, for me ctrl+q
<> : # in a tmux session launch a command line (abstract tmux command)
tmux ls
tmux list-sessions
tmux list-windows -t $session # list windows in session $session (or current)
tmux / tmux new / tmux new-session # launch a new session
tmux new -s $session # launch a new session with a name $session
<> : kill-session -t $session # kill session $session (name or number)
<> : kill-session -a # kill all sessions
<> : kill-session -a -t $session # kill all but session $session
<> : rename-session -t $session# rename session
<> : rename-window -t $session:$window # rename window
<> : detach / : attach -d # detach session
<> : a / : attach -t $session:$windows # attach session / windows (or current session)
<> : switch -t $session # switch to session $session
SHORTCUTS
session
<> + d # detach current session
<> + ) # move to next session
<> + ( # move to previous session
<> + s # interactive session selection
window
<> + c # create a new window in current session
<> + n # switch to next window
<> + p # switch to previous window
<> + $n # switch to a specific terminal $n (start from 0)
<> + , # rename current window
<> + w # interactive window selection
pane
<> + " # new horizontal pane below
<> + % # new vertical pane to the right
<> + x # kill pane
<> + z # toggle between pane zoom
<> + ctrl+n # switch to next pane
<> + ctrl+p # switch to previous pane
<> + { # swap the current pane with the previous pane
<> + } # swap the current pane with the next pane
<> + space # switch layout
<> + q # show panes number
<> + q $n # move to pane $n
<> + ! # convert pane to window
<> + left # move to left
<> + right # move to right
<> + up # move to up
<> + down # move to down
others
<> + ? # show all shortcuts
<> + t # show time in windows
<> + [ # enter in copy-mode (q or <esc> to quit)
perso
<> + R # Reload conf file
<> + m # enable mouse mode
<> + M # disable mouse mode
<> + k # kill window
<> + K # kill server
copy mode
ctrl + PageUp # enter in copy mode & scroll page up
alt + Up / alt+up # enter in copy mode & scroll page up
ctrl+s # search in history in copy mode
PLUGINS
https://github.com/tmux-plugins
RESURRECT
resurect / Persists tmux environment across system restarts
https://github.com/tmux-plugins/tmux-resurrect
<> + ctrl+s # to save current worspace (sessions)
<> + ctrl+r # to restore worspace (sessions)
The last saved worspace is a symlink 'last' to the active worspace in ~/.tmux/resurrect/ where are keeped history of saved works
autostart
sudo cat > /etc/systemd/system/tmux.service << EOF
[Unit]
Description=tmux default session (detached)
Documentation=man:tmux(1)
[Service]
Type=forking
User=nikita
Group=nikita
Environment=DISPLAY=:0
ExecStart=/usr/bin/tmux new-session -d
ExecStop=/home/${USER}/.tmux/plugins/resurect/scripts/save.sh
ExecStop=/usr/bin/tmux kill-server
KillMode=none
RestartSec=2
[Install]
WantedBy=default.target
EOF
systemctl enable tmux --now