fix(cli): exit after printing the version instead of opening a session - #1726
Open
charliezong18 wants to merge 1 commit into
Open
fix(cli): exit after printing the version instead of opening a session#1726charliezong18 wants to merge 1 commit into
charliezong18 wants to merge 1 commit into
Conversation
--version printed the Happy version and then deliberately fell through to auth, daemon startup and runClaude. On a machine without stored credentials that means a version query drops into the interactive login picker. Exit right after printing, the same way the --help branch above already does. Fixes slopus#1532
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.
happy --versionprints the version and then deliberately falls through to auth, daemon startup andrunClaude. On a machine without stored credentials that means a version query drops into the interactive login picker — which is what #1532 reports.Exit right after printing, the same way the
--helpbranch above already does.Fixes #1532
Proof
Run from source against an isolated
HAPPY_HOME_DIR(no stored credentials), stdin closed, 20s hard timeout.Before —
main:After — this branch:
Nothing else runs: no auth, no daemon, no session.
Validation
happy-clitypecheck: no new errors relative tomainpackages/happy-cli/src/index.ts; no other file touchedindex.tshas not been modified upstream since this fix was written, so it applies without drift🤖 Generated with Claude Code