|
|
@@ -0,0 +1,64 @@
|
|
|
+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), trimmed to 24;
|
|
|
+# 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).
|
|
|
+set -g @wtitle '#{?#{||:#{==:#{pane_title},},#{==:#{pane_title},#{host}}},#{pane_current_command},#{=/24/…:pane_title}}'
|
|
|
+# 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:@wtitle} '
|
|
|
+setw -g window-status-current-format ' #I:#{?#{>:#{window_panes},1},(#{window_panes}p#{?window_zoomed_flag,Z,}) ,}#{E:@wtitle} '
|
|
|
+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
|
|
|
+
|
|
|
+# 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 --continue --fork-session"; tmux select-pane -T "$T"'
|