Login OAuth URL wraps in WebStorm terminal causing "Missing state parameter" error
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When running /login in Claude Code inside WebStorm's built-in terminal (PowerShell on Windows), the generated OAuth URL is too long and gets wrapped onto the next line by the terminal. When the user copies the URL and opens it in a browser, the URL is incomplete (missing the state parameter), resulting in "Invalid OAuth Request: Missing state parameter" error.
What Should Happen?
The OAuth URL should either open automatically in the browser without requiring manual copy-paste, or the terminal output should display the full URL without line breaks regardless of terminal width.
Error Messages/Logs
Invalid OAuth Request: Missing state parameter
API Error: 401 Invalid authentication credentials
Steps to Reproduce
- Open WebStorm built-in terminal (PowerShell on Windows)
- Run
claude - Run
/loginand select "Claude account with subscription" - A long OAuth URL appears, wrapped across multiple lines in the terminal
- Copy the URL manually and open in browser
- Browser shows "Invalid OAuth Request: Missing state parameter"
Workaround found: copy the terminal output into a text editor (e.g. Word),
manually remove the line break from the middle of the URL, then paste the
complete URL into the browser — this works correctly.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.197 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
WebStorm built-in terminal (PowerShell)