fix: strip stray characters from pasted API key on Windows#169
Merged
schpet merged 1 commit intoschpet:mainfrom Mar 6, 2026
Merged
fix: strip stray characters from pasted API key on Windows#169schpet merged 1 commit intoschpet:mainfrom
schpet merged 1 commit intoschpet:mainfrom
Conversation
Cliffy's Secret.prompt injects tilde (~) characters at the start and end of pasted text on Windows terminals (bracket paste mode side-effect). This causes `auth login` to always fail with "Invalid API key" when the key is pasted interactively. Trim whitespace and strip non-key characters from both ends of the input. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
|
awesome thanks! i don't have a windows machine, so appreciate you improving support for that platform 🙌🏻 |
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.
Summary
auth loginfailing with "Invalid API key" when the key is pasted interactively on WindowsSecret.promptinjects tilde (~) characters at the start and end of pasted text on Windows terminals (bracket paste mode side-effect), e.g.~lin_api_xxx~instead oflin_api_xxx[^a-zA-Z0-9_]) from both ends of the inputTest plan
auth login --key <key>still works (unaffected path)auth logininteractive paste on Windows now succeedsSecret.promptreturns~-wrapped value on Windows🤖 Generated with Claude Code