fix(ui): skip "Press Enter" pause when user backs out of subcommand
Build / bun-build (push) Successful in 5m42s

This commit is contained in:
2026-06-16 14:49:00 +08:00
parent f2c53dce65
commit d01d6a38b5
8 changed files with 21 additions and 12 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ import {
commit,
} from "../git";
import { selectFiles } from "../selector";
import { BACK } from "../menu";
import { BACK, SKIP_WAIT } from "../menu";
import { collectProjectContext } from "../context";
import { buildPrompt, SYSTEM_PROMPT } from "../prompt";
import { generateCommitMessage } from "../ai";
@@ -221,7 +221,7 @@ export async function handleCommit(args: ParsedArgs): Promise<number> {
console.log(` ${GREEN()}Auto-staged ${unstagedFiles.length} file(s).${RESET()}`);
} else {
const selected = await selectFiles(stagedFiles, unstagedFiles);
if (selected === BACK) return 0;
if (selected === BACK) return SKIP_WAIT as unknown as number;
if (selected.length > 0) {
await stageFiles(selected);
console.log(` ${GREEN()}Staged ${selected.length} file(s).${RESET()}`);