How to automatically start tmux on SSH session? #
From https://stackoverflow.com/a/40192494/8810271
Just put it in server-side .bashrc
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then
tmux attach-session -t ssh_$USER || tmux new-session -s ssh_$USER
fi
bash
Detach from tmux session and close SSH session with 1 command #
From https://unix.stackexchange.com/a/546831
Just type
tmux detach -P
bash
Copy Content Inside tmux #
- enter copy mode using
c-b [
- navigate to beginning of text, you want to select and hit
C-Space
- move around using arrow keys to select region
- when you reach end of region simply hit
M-w
to copy the region - now
c-b ]
will paste the selection
Copy over SSH with MinTTY #
Options → Selection → Allow setting selection
And copy as usual in tmux.
If inside vim, enter copy mode first by hitting c-b [