[object Object]

← back to Ticket System

run-ticket.sh: foreground-launch fix — explicit create/select window + open -a iTerm fallback so RUN NOW foregrounds from the pm2 background daemon (verified via TK-10690)

9385a5565b5cedbb5218da30960d90b53d16c234 · 2026-08-18 13:26:18 -0700 · Steve Abrams

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

Files touched

Diff

commit 9385a5565b5cedbb5218da30960d90b53d16c234
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue Aug 18 13:26:18 2026 -0700

    run-ticket.sh: foreground-launch fix — explicit create/select window + open -a iTerm fallback so RUN NOW foregrounds from the pm2 background daemon (verified via TK-10690)
    
    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 c40bcc26..0812697c 100755
--- a/run-ticket.sh
+++ b/run-ticket.sh
@@ -39,12 +39,17 @@ osa_title="$(esc "$osa_title")"
 
 /usr/bin/osascript <<OSA
 tell application "iTerm"
-  activate
-  set newPane to current session of (create window with default profile)
+  set newWin to (create window with default profile)
+  set newPane to current session of newWin
   tell newPane
     set name to "$osa_title"
     write text "$osa_payload"
   end tell
+  activate
+  select newWin
 end tell
 OSA
+# Belt-and-suspenders: LaunchServices foregrounding works from a pm2 background daemon
+# where a bare Apple-event `activate` may not. Harmless if iTerm is already front.
+/usr/bin/open -a iTerm 2>/dev/null || /usr/bin/open -a iTerm2 2>/dev/null || true
 echo "run-ticket: launched iTerm2 window for $ID (cwd $CWD)"

← a57a664f ticket-board /api/run: log real launch outcome from execFile  ·  back to Ticket System  ·  Add priority ranking + per-ticket ratings to tk board (mirro cf9ad290 →