session-tools/tmux.conf

56 lines
2.6 KiB
Text
Raw Permalink Normal View History

# Reduce escape sequence latency — default 500ms makes scroll feel completely broken
# in TUI apps (Claude Code, vim, etc.) because each wheel event uses escape sequences.
set -s escape-time 10
# Pass focus events through to applications (Claude Code uses these)
set -g focus-events on
# True color passthrough
set -ga terminal-overrides ",*256col*:Tc"
# Larger scrollback for when you need tmux copy mode
set -g history-limit 50000
# Mouse wheel scrolls tmux scrollback (auto-enters copy mode) instead of being
# passed as arrow keys to the inner app (which would scroll Claude history etc.)
# Hold Option on macOS to bypass tmux and use native terminal selection.
set -g mouse on
# Resize panes to the active client's size, not the smallest attached. Matters
# when reattaching the same durable session from different terminals (phone,
# laptop, IDE pane) — otherwise the layout collapses to the smallest viewer.
setw -g aggressive-resize on
# Forward copy-mode selections to the OS clipboard via OSC 52, so mouse-drag
# or `y` in copy mode actually lands in the local terminal's clipboard even
# across ssh + tmux. The terminal-features lines tell tmux to use OSC 52
# regardless of what the termcap entry advertises — necessary for many
# terminals (e.g. macOS Terminal.app, older iTerm2, kitty without overrides)
# where the clipboard capability isn't auto-detected.
set -g set-clipboard on
set -as terminal-features ',*:clipboard'
set -as terminal-overrides ',*:Ms=\E]52;c;%p2%s\007'
# Explicit copy-pipe bindings so mouse-drag-release and `y` in copy mode both
# stage the selection into tmux's buffer (which set-clipboard then OSC52s).
# Covers both default and vi copy-mode keytables.
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-no-clear
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear
bind-key -T copy-mode y send-keys -X copy-pipe-and-cancel
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
# Keep window indexes contiguous when one closes; quiet the activity flag spam.
set -g renumber-windows on
setw -g monitor-activity off
# Surface hostname everywhere — matters when stacking rclaude/ssh tmuxes across
# plum/apricot and you need to know which host the active pane is on.
# - Terminal window title: <host> · <tmux session name> (read by iTerm/macOS title bar)
# - tmux status-left: [<host>] <session>
# - tmux status-right: <date> <time>
set -g set-titles on
set -g set-titles-string '#H · #S'
set -g status-left '#[fg=cyan,bold][#H]#[default] #S '
set -g status-right '%a %H:%M'
set -g status-left-length 40