IT notes


Set window title: <c-b>, Get pannel number: <c-b>q Show clock: <c-b>t Move pane to a new window: <c-b>! Join panes: <c-b>: join-pane -s 0 -t 3 move pane 1 to window 3 <c-b>: join-pane -t :1 move current pane to window 1 List sessions: <c-b>s <c-b>w expanded Move pane to a another session: <c-b>m mark the pane <c-b>w go to the destination window/session <c-b>: join-pane or go to the pane you want to move, check the session name and windows you would like to move and try:

tmux ssh

Tmux multiple ssh connections with synchronized panels If need to debug/check in real-time multiple servers via ssh, this can be used. tmux script #!/bin/sh TARGET="tmux-ssh" SSH_USER="devops" i=0 while read line do if [ $i == 0 ] then tmux new-window -a -n ${TARGET} "ssh -l ${SSH_USER} ${line}" else tmux split-window -t "${TARGET}" "ssh -l ${SSH_USER} ${line}" && \ tmux select-layout -t "${TARGET}" tiled fi let i++ done < "${1:-/dev/stdin}" tmux set-window-option -t ${TARGET} synchronize-panes on hosts If the input is json, jq can be used to extract hosts, assuming your output is similar to:


asciinema [as-kee-nuh-muh] is a free and open source solution for recording terminal sessions and sharing them on the web. Install FreeBSD: pkg install asciiname OS X: brew update && brew install asciinema Recording tmux session Setup your tmux session create windows, splits, start processes in them: tmux new -s name Detach (prefix+d) and start recording with: asciinema rec -c "tmux attach -t name" /tmp/play.json When you’re finished, just detach the session again and play it with: