From ad0b7b7f6afab2c7f7640670db2cf3d6cb21e1e9 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Mon, 22 Dec 2025 00:32:47 -0800 Subject: [PATCH] Add --all flag to gt theme apply, fix session handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add --all/-a flag to apply themes across all rigs, not just current - Add proper handling for deacon and witness sessions in theme apply - Fix crew status line to show full path: rig/crew/name Previously, gt theme apply only applied to sessions in the current rig, and skipped deacon/witness sessions due to different naming patterns. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/cmd/theme.go | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/internal/cmd/theme.go b/internal/cmd/theme.go index 9147dafc..31fae0c5 100644 --- a/internal/cmd/theme.go +++ b/internal/cmd/theme.go @@ -13,8 +13,9 @@ import ( ) var ( - themeListFlag bool - themeApplyFlag bool + themeListFlag bool + themeApplyFlag bool + themeApplyAllFlag bool ) var themeCmd = &cobra.Command{ @@ -35,7 +36,11 @@ Examples: var themeApplyCmd = &cobra.Command{ Use: "apply", - Short: "Apply theme to all running sessions in this rig", + Short: "Apply theme to running sessions", + Long: `Apply theme to running Gas Town sessions. + +By default, only applies to sessions in the current rig. +Use --all to apply to sessions across all rigs.`, RunE: runThemeApply, } @@ -43,6 +48,7 @@ func init() { rootCmd.AddCommand(themeCmd) themeCmd.AddCommand(themeApplyCmd) themeCmd.Flags().BoolVarP(&themeListFlag, "list", "l", false, "List available themes") + themeApplyCmd.Flags().BoolVarP(&themeApplyAllFlag, "all", "a", false, "Apply to all rigs, not just current") } func runTheme(cmd *cobra.Command, args []string) error { @@ -124,6 +130,16 @@ func runThemeApply(cmd *cobra.Command, args []string) error { theme = tmux.MayorTheme() worker = "Mayor" role = "coordinator" + } else if session == "gt-deacon" { + theme = tmux.DeaconTheme() + worker = "Deacon" + role = "health-check" + } else if strings.HasPrefix(session, "gt-witness-") { + // Witness sessions: gt-witness- + rig = strings.TrimPrefix(session, "gt-witness-") + theme = getThemeForRig(rig) + worker = "witness" + role = "witness" } else { // Parse session name: gt-- or gt--crew- parts := strings.SplitN(session, "-", 3) @@ -132,8 +148,8 @@ func runThemeApply(cmd *cobra.Command, args []string) error { } rig = parts[1] - // Skip if not matching current rig (if we know it) - if rigName != "" && rig != rigName { + // Skip if not matching current rig (unless --all flag) + if !themeApplyAllFlag && rigName != "" && rig != rigName { continue }