fix(ui): skip "Press Enter" pause when user backs out of subcommand
Build / bun-build (push) Successful in 5m42s
Build / bun-build (push) Successful in 5m42s
This commit is contained in:
@@ -15,6 +15,7 @@ import { setColorEnabled } from "./src/terminal";
|
||||
import { BOLD, GREEN, CYAN, DIM, RESET } from "./src/terminal";
|
||||
import { isStdinTTY, initTTY } from "./src/tty";
|
||||
import { showBanner } from "./src/brand";
|
||||
import { SKIP_WAIT } from "./src/menu";
|
||||
|
||||
// ── Interactive Menu (mole-style) ─────────────────────────────────────
|
||||
|
||||
@@ -153,6 +154,9 @@ async function dispatchAndWait(item: MenuItem, wasRaw: boolean): Promise<number>
|
||||
process.stdin.pause();
|
||||
process.stdout.write("\x1b[2J\x1b[H"); // clear screen
|
||||
const result = await dispatchMenuAction(item.key);
|
||||
if (result === (SKIP_WAIT as unknown as number)) {
|
||||
return 0; // user explicitly backed out — skip "Press Enter" and return directly
|
||||
}
|
||||
await waitForEnter();
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user