Skip to content

fix(cli): stop interactive prompts hanging behind the status spinner#96

Merged
sampleXbro merged 1 commit into
masterfrom
develop
Jul 10, 2026
Merged

fix(cli): stop interactive prompts hanging behind the status spinner#96
sampleXbro merged 1 commit into
masterfrom
develop

Conversation

@sampleXbro

@sampleXbro sampleXbro commented Jul 10, 2026

Copy link
Copy Markdown
Owner

install, uninstall, and refresh held a clack spinner across the whole run; its redraw timer overwrote the interactive prompts underneath (skill-pack select, broken-link, invalid-resource confirm, uninstall drift, and the refresh consent prompt), so the command waited on invisible stdin — refresh silently timed out after 5 minutes and skipped the pack. Skip the spinner whenever a run may prompt (real TTY, no --force/--dry-run) via a shared mayPrompt() gate, mirroring init.

Also harden the prompt primitives:

  • confirm() now delegates to the shared readLine helper, so a closed or erroring stdin declines gracefully instead of hanging on Ctrl-D or crashing.
  • readLine() resolves to '' (decline) on a stream error instead of throwing.
  • install --force --dry-run now previews the same resource set a real --force install writes (invalid resources were wrongly dropped from the preview).

Tests: refresh spinner-gating, confirm() EOF/error via readLine, readLine stream-error, and pool-resolution force+dry-run precedence.

What does this PR do?

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Test coverage

Checklist

  • Tests written first (TDD)
  • All CI checks pass (pnpm test, pnpm lint, pnpm typecheck)
  • Changeset added (pnpm changeset) for user-visible changes

install, uninstall, and refresh held a clack spinner across the whole run;
its redraw timer overwrote the interactive prompts underneath (skill-pack
select, broken-link, invalid-resource confirm, uninstall drift, and the
refresh consent prompt), so the command waited on invisible stdin — refresh
silently timed out after 5 minutes and skipped the pack. Skip the spinner
whenever a run may prompt (real TTY, no --force/--dry-run) via a shared
mayPrompt() gate, mirroring init.

Also harden the prompt primitives:
- confirm() now delegates to the shared readLine helper, so a closed or
  erroring stdin declines gracefully instead of hanging on Ctrl-D or crashing.
- readLine() resolves to '' (decline) on a stream error instead of throwing.
- install --force --dry-run now previews the same resource set a real --force
  install writes (invalid resources were wrongly dropped from the preview).

Tests: refresh spinner-gating, confirm() EOF/error via readLine, readLine
stream-error, and pool-resolution force+dry-run precedence.
@sampleXbro
sampleXbro merged commit c2a2654 into master Jul 10, 2026
20 checks passed
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/cli/command-handlers.ts 100.00% <100.00%> (+6.76%) ⬆️
src/install/core/pool-resolution.ts 100.00% <100.00%> (ø)
src/install/prompts/prompt-io.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants