tmux advanced oprations - githeim/windheim_archive GitHub Wiki
Introduce advanced operations for tmux through command line.
tmux configuration
.tmux.conf
set -g default-terminal "screen-256color"
# use vim keybindings in copy mode
setw -g mode-keys vi
# set scrollback history to 100000 (100k)
set -g history-limit 100000
bind k resize-pane -R
bind j resize-pane -L
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
create and kill tmux sessions
$ tmux new-session -d -s MY_new_session
$ tmux kill-session -t MY_new_session
split panes
$ tmux split-window -t MY_new_session
$ tmux select-pane -t 0
$ tmux split-window -h -t MY_new_session
send keys to pane
$ tmux select-pane -t 0
$ tmux send-keys -t UDR_back:0 'ls ; touch test' Enter
tmux lost server error
$ tmux
lost server
$ tmux kill-server
error connecting to /tmp/tmux-1000/default (No such file or directory)
for this error, you should make directory /tmp/tmux-1000
$ ls /tmp/tmux-1000
ls: cannot access '/tmp/tmux-1000': No such file or directory
$ mkdir -p /tmp/tmux-1000
then it will work fine