fabic974 random (binary) wanderings in the philament empires…

Shell(s): notes

TMUX

From SO, about that strange mouse right button click behaviour :

-m and -M are used to set and clear the marked pane. There is one marked pane at a time, setting a new marked pane clears the last. The marked pane is the default target for -s to join-pane, swap-pane and swap-window. [See man tmux]

# /usr/bin/env bash
set -euo pipefail

# Make three vertically split windows with text in each.
tmux split-window -v
tmux split-window -v
tmux select-layout even-vertical
tmux send-keys -t 0 'echo pane zero' C-m
tmux send-keys -t 1 'echo pane one' C-m
tmux send-keys -t 2 'echo pane two' C-m

# You can now swap the current pane with an explicitly targeted pane. Here, we
# change pane ordering from 0-1-2 to 1-0-2, and back again.
tmux select-pane -t 0
tmux swap-pane -t 1
tmux swap-pane -t 1

# You can also swap panes by "marking" one and letting the target of the swap be
# implicit. Here, we change ordering from 0-1-2 to 1-0-2, and back again.
tmux select-pane -t 0
tmux select-pane -t 1 -m
tmux swap-pane
tmux swap-pane

TODO: find out how you’d further automatize your shell xp. with bash scripts (?)

EOF