tmux Install and Setup Install Tmux Plugin Manager (TPM) :
sudo apt install -y tmux xclip
mkdir -p ~/my_data/
cat > ~/.tmux.conf <<'EOF'
set -g history-limit 50000
set -g mouse on
set -g @logs_dir "$HOME/my_data/tmux_logs"
run-shell 'mkdir -p "#{@logs_dir}"'
set-hook -g after-new-session 'pipe-pane -o "cat >> #{@logs_dir}/$(date +%Y%m%d-%H%M%S)-#{session_name}-#{window_index}-#{pane_index}.log"'
set-hook -g after-new-window 'pipe-pane -o "cat >> #{@logs_dir}/$(date +%Y%m%d-%H%M%S)-#{session_name}-#{window_index}-#{pane_index}.log"'
set-hook -g after-split-window 'pipe-pane -o "cat >> #{@logs_dir}/$(date +%Y%m%d-%H%M%S)-#{session_name}-#{window_index}-#{pane_index}.log"'
set-hook -g session-created 'run-shell "tmux list-panes -s -F \"#{pane_id}\" | xargs -I{} tmux pipe-pane -t {} -o \"cat >> #{@logs_dir}/$(date +%Y%m%d-%H%M%S)-restored-{}.log\""'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'tmux-plugins/tmux-pain-control'
# set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'catppuccin/tmux'
set -g @continuum-restore 'on'
set -g @continuum-save-interval '15'
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-strategy-vim 'session'
set -g @catppuccin_flavour 'mocha'
set -g @catppuccin_window_status_style "rounded"
set -g status-right "#{E:@catppuccin_status_session} #{E:@catppuccin_status_host}"
run '~/.tmux/plugins/tpm/tpm'
EOF
[ ! -d ~/.tmux/plugins/tpm ] && git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
export TMUX_PLUGIN_MANAGER_PATH= " $HOME/.tmux/plugins/"
tmux start-server
tmux new-session -d
$TMUX_PLUGIN_MANAGER_PATH/tpm/bin/install_plugins
tmux kill-server
printf '\n[ -z "$TMUX" ] && exec tmux\n' >> ~/.bashrc
printf '\n[ -z "$TMUX" ] && exec tmux\n' >> ~/.zshrc Tmux Core Hotkeys Default Prefix: CTRL+B
Action Hotkey Description Create New Tab (Window) Prefix + CCreates a new tmux window (full-screen tab). Next Tab Prefix + NSwitches to the next tmux window. Previous Tab Prefix + PSwitches to the previous tmux window. Switch by Number Prefix + 0-9Jumps directly to a window by index. Rename Current Tab Prefix + ,Renames the current window for easier tracking.
Note: Logging is enabled by default in this config via pipe-pane, with one timestamped file per pane in ~/.tmux/logs/ (format: YYYYmmdd-HHMMSS-session-window-pane.log). The plugin hotkeys below are still useful for manual/retroactive captures. See docs for changing plugin logging options .
Action Hotkey Description Toggle Logging Prefix + Shift + PStarts/stops logging the current pane to a file. Retroactive Log Prefix + Alt + Shift + PSaves the entire pane history (up to history-limit) if you forgot to start logging initially. Pane Capture Prefix + Alt + PSaves only the currently visible screen. Solves copy/paste formatting messes when panes are split.