From af31cd74ab1aa29b6dcdeab8f78264f4babe5475 Mon Sep 17 00:00:00 2001 From: Chris La Date: Tue, 17 Mar 2026 09:10:17 -0700 Subject: [PATCH] Improve setup login: add browser hint and inherit env MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Print helpful message before auth ("If a browser window does not open, copy the URL from the output below") - Explicitly inherit environment via cmd.Env so DISPLAY/WAYLAND_DISPLAY are available for browser opening on Linux - Fix README: claude /login → claude auth login Co-Authored-By: Claude Opus 4.6 --- README.md | 2 +- claude_code/wrapper/main.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d7f94a..62b1662 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ The wrapper exposes two subcommands: ### `setup` -Runs `claude /login` to authenticate with Anthropic. +Runs `claude auth login` to authenticate with Anthropic. ```sh strawpot_claude_code setup diff --git a/claude_code/wrapper/main.go b/claude_code/wrapper/main.go index 6a0adea..8f52b4f 100644 --- a/claude_code/wrapper/main.go +++ b/claude_code/wrapper/main.go @@ -46,10 +46,17 @@ func cmdSetup() { os.Exit(1) } + fmt.Fprintln(os.Stderr, "Starting Claude Code login...") + fmt.Fprintln(os.Stderr, "If a browser window does not open, copy the URL from the output below.") + fmt.Fprintln(os.Stderr) + cmd := exec.Command(claudePath, "auth", "login") cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr + // Inherit full environment so DISPLAY/WAYLAND_DISPLAY are available + // for browser opening on Linux. + cmd.Env = os.Environ() if err := cmd.Run(); err != nil { if exitErr, ok := err.(*exec.ExitError); ok {