gt down --all: also kill tmux server

This commit is contained in:
Steve Yegge
2025-12-23 02:04:17 -08:00
parent 18fb0e05fe
commit be5509fb18
2 changed files with 21 additions and 0 deletions

View File

@@ -36,11 +36,13 @@ This is useful for:
var (
downQuiet bool
downForce bool
downAll bool
)
func init() {
downCmd.Flags().BoolVarP(&downQuiet, "quiet", "q", false, "Only show errors")
downCmd.Flags().BoolVarP(&downForce, "force", "f", false, "Force kill without graceful shutdown")
downCmd.Flags().BoolVarP(&downAll, "all", "a", false, "Also kill the tmux server")
rootCmd.AddCommand(downCmd)
}
@@ -96,6 +98,16 @@ func runDown(cmd *cobra.Command, args []string) error {
printDownStatus("Daemon", true, "not running")
}
// 5. Kill tmux server if --all
if downAll {
if err := t.KillServer(); err != nil {
printDownStatus("Tmux server", false, err.Error())
allOK = false
} else {
printDownStatus("Tmux server", true, "killed")
}
}
fmt.Println()
if allOK {
fmt.Printf("%s All services stopped\n", style.Bold.Render("✓"))