fix(down): prevent tmux server exit when all sessions killed

When gt down --all killed all Gas Town sessions, if those were the only
tmux sessions, the server would exit due to tmux's default exit-empty
setting. Users perceived this as gt down --all killed my tmux server.

Fix: Set exit-empty off before killing sessions, ensuring the server
stays running for subsequent gt up commands. The --nuke flag still
explicitly kills the server when requested.

Fixes: gt-kh8w47

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gastown/crew/joe
2026-01-17 01:34:27 -08:00
committed by Steve Yegge
parent 885b5023d3
commit 5823c9fb36
2 changed files with 23 additions and 0 deletions
+6
View File
@@ -95,6 +95,12 @@ func runDown(cmd *cobra.Command, args []string) error {
return fmt.Errorf("cannot proceed: %w", err)
}
defer func() { _ = lock.Unlock() }()
// Prevent tmux server from exiting when all sessions are killed.
// By default, tmux exits when there are no sessions (exit-empty on).
// This ensures the server stays running for subsequent `gt up`.
// Ignore errors - if there's no server, nothing to configure.
_ = t.SetExitEmpty(false)
}
allOK := true