From c6927d4ae86f64b4b6e1405483f4e6a95cb9ca1e Mon Sep 17 00:00:00 2001 From: Natalie Date: Sun, 17 May 2026 08:00:13 -0700 Subject: [PATCH] =?UTF-8?q?fix(@scripts):=20=F0=9F=90=9B=20adjust=20tmux?= =?UTF-8?q?=20session=20display=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- bin/rclaude | 22 ++++++++++------------ tmux.conf | 15 ++++++++++++++- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/bin/rclaude b/bin/rclaude index b793dfe..237b9e9 100755 --- a/bin/rclaude +++ b/bin/rclaude @@ -786,22 +786,20 @@ cmd_resume() { } function fit(s, n) { return length(s) > n ? substr(s, 1, n-1) "…" : s } # The trailing column (NF) is the optional display name set via - # `claude -n`. Wrap it in c_name when present. - function name_tag() { - if ($NF == "" || $2 == "tmux") return "" - return " " c_name "‹" $NF "›" r - } + # `claude -n`. Promoted to column B: blank when absent. function display() { - if ($2 == "tmux") - return c_tmux "▶ " r $3 - if ($2 == "triage") - return prio_c($4) "P" $4 r " " stat_c($5) sprintf("%-15s", $5) r " " $6 " " c_dim "[" substr($3,1,8) "]" r name_tag() - if ($2 == "session") - return $4 " " c_dim "[" substr($3,1,8) "]" r name_tag() + if ($2 == "tmux") return c_tmux "▶ " r $3 + if ($2 == "triage") return prio_c($4) "P" $4 r " " stat_c($5) sprintf("%-15s", $5) r " " $6 " " c_dim "[" substr($3,1,8) "]" r + if ($2 == "session") return $4 " " c_dim "[" substr($3,1,8) "]" r return $3 } + function name_col() { return ($2=="tmux") ? "" : $NF } { - printf "%s%-10s%s %s%-22s%s %s", c_host, $1, r, c_dim, fit(dir_label(), 22), r, display() + printf "%s%-10s%s %s%-22s%s %s%-22s%s %s", + c_host, $1, r, + c_name, fit(name_col(), 22), r, + c_dim, fit(dir_label(), 22), r, + display() } ' if [ ! -t 0 ] || [ ! -t 2 ]; then diff --git a/tmux.conf b/tmux.conf index 5382f49..2b50376 100644 --- a/tmux.conf +++ b/tmux.conf @@ -23,8 +23,21 @@ 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. +# 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