[object Object]

← back to Ticket System

run-ticket: title iTerm windows with ticket number + job, re-assert past zsh precmd (TK-10573)

c06d389bc798e9ae2272919967a51f14b5856e29 · 2026-08-20 15:57:47 -0700 · Steve Abrams

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit c06d389bc798e9ae2272919967a51f14b5856e29
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Aug 20 15:57:47 2026 -0700

    run-ticket: title iTerm windows with ticket number + job, re-assert past zsh precmd (TK-10573)
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 run-ticket.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/run-ticket.sh b/run-ticket.sh
index 0812697c..b8204140 100755
--- a/run-ticket.sh
+++ b/run-ticket.sh
@@ -31,8 +31,13 @@ PROMPT_EOF
 
 # Build the inner shell payload, then escape for an AppleScript double-quoted literal
 # (same technique as task.sh): backslash first, then double-quote.
-payload="cd $(printf %q "$CWD") && claude $(printf %q "$PROMPT")"
-osa_title="Run ${ID}"
+# Title the window with the SHORT ticket number so iTerm's profile appends the running
+# job -> "TK-<n> (node)" = ticket + job ("both", per Steve TK-10573). A backgrounded
+# re-assert fires ~5s in (after zsh's shell-integration precmd hook has run, which would
+# otherwise overwrite the launch-time name) and again on a short loop for the first minute.
+retitle="( for i in 1 2 3 4; do sleep 5; \"$HOME/bin/tk-iterm-title\" TK-${IDNUM}; done ) >/dev/null 2>&1 &"
+payload="cd $(printf %q "$CWD") && ${retitle} claude $(printf %q "$PROMPT")"
+osa_title="TK-${IDNUM}"
 esc() { local s="$1"; s="${s//\\/\\\\}"; s="${s//\"/\\\"}"; printf '%s' "$s"; }
 osa_payload="$(esc "$payload")"
 osa_title="$(esc "$osa_title")"

← 7278d277 auto-data-snapshot: 2026-08-19T23:51:10 (2 data files) — TK-  ·  back to Ticket System  ·  tk: self-title iTerm window (name + durable user.tk) on take 18e23f99 →