feat(status): mirror topic into tmux status bar
set-topic.sh now renames the tmux session to the project part of the
topic and stores the full topic in @claude_topic when run inside tmux.
Pairs with ~/.tmux.conf status-right showing #{@claude_topic}.
Claude-Session: https://claude.ai/code/session_01Xt2b3uQtakYGhH5Y653vwd
This commit is contained in:
@@ -11,6 +11,16 @@ TOPIC="$*"
|
||||
HASH=$(echo -n "$CWD" | md5sum | cut -d' ' -f1)
|
||||
SESSION_FILE="/tmp/claude-session-id-$HASH"
|
||||
|
||||
# If running inside tmux, mirror the topic into the tmux status bar:
|
||||
# session name = project part (before ':'), @claude_topic = full topic.
|
||||
if [[ -n "${TMUX:-}" ]]; then
|
||||
PROJECT="${TOPIC%%:*}"
|
||||
# tmux session names may not contain ':' or '.'
|
||||
PROJECT=$(echo "$PROJECT" | tr ':.' '--' | cut -c1-30)
|
||||
tmux rename-session "$PROJECT" 2>/dev/null || true
|
||||
tmux set -q @claude_topic "$TOPIC" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
if [[ ! -f "$SESSION_FILE" ]]; then
|
||||
# Session ID file doesn't exist yet — the statusline hook hasn't run.
|
||||
# Write the topic to a pending file so statusline.sh can pick it up
|
||||
|
||||
Reference in New Issue
Block a user