feat: hybrid Ctrl-C + picker-first bare perchd + -v/--version (0.5.0)#3
Merged
Conversation
Wire cac's .version() from package.json, read via ../package.json relative to the entry — resolves the same under tsx (src/cli.ts) and the bundled dist/cli.js (the tarball ships package.json one level above dist/). Test drives the real entry through tsx so it guards the actual flag, not a stand-in.
…o detaches
Bare `perchd`/`switch` own the server they start, so Ctrl-C (and window-close
via SIGHUP) stop it, matching `npm run dev` — the drop-in promise. `perchd attach`
does not own the server, so Ctrl-C only detaches; killing something you attached
to peek at would be a footgun. The banner states which, per mode.
runViewport now reports {interrupted, signal} and never signals the server
itself; attachViewport applies the stop-vs-detach policy (graceful stopGroup on
SIGINT, best-effort SIGTERM-to-group on SIGHUP since the terminal is gone).
BREAKING (0.5.0): reverses the 0.4.0 'Ctrl-C always detaches' invariant.
…sion - README: reframe around 'Ctrl-C stops, like npm run dev' with the attach exception; fix the hero line, quickstart, migration table, and FAQ. - CLAUDE.md + CONTRIBUTING: document the hybrid stopOnInterrupt model and that runViewport stays pure (reports the signal; policy lives in attachViewport). - CHANGELOG: 0.5.0 with the breaking Ctrl-C reversal and the --version fix. - Bump to 0.5.0.
…cted 0.4.0 made bare perchd inside a worktree silently run that worktree — hiding the other worktrees and, with them, perchd's whole 'switch without cd' point. Restore the picker as the default, but float the cwd worktree to the top and pre-select it (clack initialValue): Enter re-runs where you stand (the npm run dev drop-in), arrowing to another is the switch. `perchd <branch>` still skips the menu. A non-interactive bare perchd now fails with a clear 'name a target' message instead of a raw uv_tty_init crash.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three UX fixes on top of the published 0.4.0, all in 0.5.0.
1.
perchd -v/--version(was an error)perchd --versionthrewUnknown option. Now wired to cac's.version(), read frompackage.jsonso it's correct under both the published binary andpnpm dev.2. Hybrid Ctrl-C — the drop-in stops on Ctrl-C again
0.4.0 made Ctrl-C detach and never stop, which violates the
npm run devmuscle memory the drop-in is built on. Now it's hybrid, keyed on who started the server:perchd/perchd <branch>/switch(you started it)npm run devperchd attach(peeking at a running one)runViewportstays pure — reports{ interrupted, signal }, never signals the server; the stop-vs-detach policy lives inattachViewport(stopOnInterrupt), and the banner states the mode.perchd stopstill kills from anywhere.3. Bare
perchdshows the worktree picker again (cwd pre-selected)This is the important one. 0.4.0 made bare
perchdinside a worktree silently run that worktree and never show the menu — which hid the other worktrees and, with them, perchd's actual moat: switching what you preview withoutcd-ing between worktrees.Now bare
perchdalways shows the picker, with the worktree you're standing in floated to the top and pre-selected:npm run devdrop-in, one gesture).perchd <branch>still skips the menu for direct/scripted use.perchd(piped / CI) now fails with a clear "name a target" message instead of a rawuv_tty_initcrash.Verification
pnpm typecheckclean ·pnpm test125/125 ·pnpm buildclean.perchd <branch> -dskips the menu; non-TTY gives the clean error.Release
BREAKING vs 0.4.0 (Ctrl-C reversal) → 0.5.0. Not merged or published — your call, since it's breaking and npm is immutable.
perchd devstill works with its deprecation hint. CLAUDE.md, CONTRIBUTING, README, and CHANGELOG all updated.