Merge pull request #153 from Jah-yee/main

fix: make /exit use graceful shutdown, add /kill for immediate exit
This commit is contained in:
TÂCHES 2026-03-12 22:49:12 -06:00 committed by GitHub
commit 24302942d0

View file

@ -64,9 +64,20 @@ export default function (pi: ExtensionAPI) {
registerGSDCommand(pi);
registerWorktreeCommand(pi);
// ── /exit — kill the process immediately ──────────────────────────────
// ── /exit — graceful exit (cleanup auto-mode, save state) ──────────────
pi.registerCommand("exit", {
description: "Exit GSD immediately",
description: "Exit GSD gracefully (saves auto-mode state)",
handler: async (_ctx) => {
// Gracefully stop auto-mode if running (saves activity log, clears locks)
const { stopAuto } = await import("./auto.js");
await stopAuto(_ctx, pi);
process.exit(0);
},
});
// ── /kill — immediate exit (bypass cleanup) ─────────────────────────────
pi.registerCommand("kill", {
description: "Exit GSD immediately (no cleanup)",
handler: async (_ctx) => {
process.exit(0);
},