Skip to content

fix(cli): show login URL and support WSL2 browser opening - #186

Merged
cpojer merged 2 commits into
mainfrom
05-06-fix_cli_show_login_url_and_support_wsl2_browser_opening
May 6, 2026
Merged

cpojer merged 2 commits into
mainfrom
05-06-fix_cli_show_login_url_and_support_wsl2_browser_opening

Conversation

@shulaoda

@shulaoda shulaoda commented May 6, 2026

Copy link
Copy Markdown
Member

Summary

  • On Windows WSL2 process.platform === 'linux', so void auth login invoked xdg-open, which silently fails (no X server / no default browser). The CLI hung on the spinner with no fallback URL, leaving users unable to log in.
  • runLogin now accepts an onUrl callback; promptForLoginToken updates the spinner message with the login URL so users can open it manually on any platform when auto-open fails.
  • Added WSL detection (WSL_DISTRO_NAME / WSL_INTEROP) and try wslview then cmd.exe /c start before falling back to xdg-open.

Test plan

  • pnpm test test/unit/login-command.test.ts test/unit/init.test.ts — 160 passed
  • pnpm --filter void run typecheck — clean
  • Manual: run void auth login on WSL2 Ubuntu and confirm the URL is displayed in the spinner and the browser opens via wslview / cmd.exe
  • Manual: run void auth login on native Windows / macOS / Linux and confirm no regression

Fixes void-sdk/void#14

@shulaoda
shulaoda requested a review from cpojer May 6, 2026 02:59

@cpojer cpojer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@cpojer
cpojer merged commit 88d117c into main May 6, 2026
9 checks passed
@cpojer
cpojer deleted the 05-06-fix_cli_show_login_url_and_support_wsl2_browser_opening branch May 6, 2026 03:45
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.

Cannot run pnpm void auth login on Windows wsl2

2 participants