| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- set -g mouse on
- set -g base-index 1
- setw -g pane-base-index 1
- set -g history-limit 50000
- set -s escape-time 0
- set -g focus-events on
- set -g extended-keys on
- set -g display-time 4000
- set -g status-interval 5
- setw -g aggressive-resize on
- set -g status-keys emacs
- # Status bar as a tab bar
- set -g status-position bottom
- set -g status-style 'bg=colour235 fg=colour7'
- set -g status-left ' '
- # prefix-highlight (native #{client_prefix} — no plugin needed) + copy/sync indicators.
- # Indicators prepend to status-right so [+] [d] stay flush-right (mouse math intact).
- set -g status-right '#{?client_prefix,#[bg=colour3#,fg=colour235#,bold] ^B #[default] ,}#{?#{==:#{pane_mode},copy-mode},#[bg=colour2#,fg=colour235#,bold] COPY #[default] ,}#{?pane_synchronized,#[bg=colour1#,fg=colour15#,bold] SYNC #[default] ,} [+] [d] '
- # Tab label = the app's pane title (Claude Code sets a good one);
- # falls back to the running command for bare shells (where pane_title == hostname).
- # #{E:...} forces the stored format in @wtitle to expand. Replaces #W to dodge the
- # window-name pollution (apps leak junk like "2.1.156" into the window NAME).
- # @wtitle = full (feeds Ghostty title), @wtab = truncated (feeds status-bar tabs).
- set -g @wtitle '#{?#{||:#{==:#{pane_title},},#{==:#{pane_title},#{host}}},#{pane_current_command},#{pane_title}}'
- set -g @wtab '#{?#{||:#{==:#{pane_title},},#{==:#{pane_title},#{host}}},#{pane_current_command},#{=/24/…:pane_title}}'
- # Forward the active pane's title to the outer terminal (Ghostty tab/window title)
- set -g set-titles on
- set -g set-titles-string '#{E:@wtitle}'
- # Tab: index:(NpZ) title — pane count + zoom flag prefixed in parens, only when split.
- setw -g window-status-format ' #I:#{?#{>:#{window_panes},1},(#{window_panes}p#{?window_zoomed_flag,Z,}) ,}#{E:@wtab} '
- setw -g window-status-current-format ' #I:#{?#{>:#{window_panes},1},(#{window_panes}p#{?window_zoomed_flag,Z,}) ,}#{E:@wtab} '
- setw -g window-status-current-style 'bg=colour4 fg=colour15 bold'
- set -g pane-border-status top
- # Click [+] to create new tab, [d] to detach
- bind -n MouseDown1StatusRight run-shell -b '\
- x="#{mouse_x}"; \
- w=$(tmux display-message -p "#{window_width}"); \
- pos=$((w - x)); \
- if [ "$pos" -ge 0 ] && [ "$pos" -le 3 ]; then \
- tmux detach-client; \
- elif [ "$pos" -ge 4 ] && [ "$pos" -le 8 ]; then \
- tmux new-window; \
- fi'
- # Close tab: just type exit (or Ctrl-d) in the shell
- # Window management menu (prefix + w)
- bind w display-menu -T "Windows" \
- "New Window" n "new-window" \
- "Kill Window" k "kill-window" \
- "Next Window" l "next-window" \
- "Prev Window" h "previous-window" \
- "" \
- "Horizontal Split" - "split-window -v" \
- "Vertical Split" | "split-window -h" \
- "" \
- "Kill Pane" x "kill-pane" \
- "Zoom Pane" z "resize-pane -Z" \
- "" \
- "Choose Session" s "choose-tree -s"
- bind-key -n M-w new-window
- # Navigation hierarchy (no prefix), shared with Zed where possible:
- # Shift+arrow -> tabs/windows (flat, left/right only)
- # Ctrl+Shift+arrow -> panes (the 2D grid). Same chord in Zed.
- # Modified arrows arrive as legacy CSI 1;6 sequences, so tmux parses C-S-Left
- # natively -- no user-keys translation needed. Never use Cmd here: Ghostty
- # owns it and never forwards it to tmux.
- # -r lets you hold/repeat within repeat-time.
- bind-key -n -r S-Left previous-window
- bind-key -n -r S-Right next-window
- bind-key -n -r C-S-Left select-pane -L
- bind-key -n -r C-S-Right select-pane -R
- bind-key -n -r C-S-Up select-pane -U
- bind-key -n -r C-S-Down select-pane -D
- # Fork Claude Code session into a new window
- bind R source-file ~/.tmux.conf \; display "Reloaded"
- bind f run-shell 'T="Fork ($(date "+%a %H:%M"))"; tmux new-window -a -n "$T" "claude --dangerously-skip-permissions --resume --fork-session"; tmux select-pane -T "$T"'
- # >>> tmux-claude-status >>>
- source-file /Users/tom/.claude/tmux-claude-status.conf
- # <<< tmux-claude-status <<<
|