Skip to content

Commit 474d57f

Browse files
juhgiyoclaude
andauthored
Improve setup login: browser hint and env inheritance (#11)
## Summary - Print helpful message before login ("If a browser window does not open, copy the URL from the output below") - Explicitly inherit environment via `cmd.Env = os.Environ()` so `DISPLAY`/`WAYLAND_DISPLAY` are available for browser opening on Linux ## Test plan - [x] `go test -v ./...` passes - [ ] Test on Linux: verify browser opens or URL is visible in output 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3a37ad7 commit 474d57f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

codex/wrapper/main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,17 @@ func cmdSetup() {
4646
os.Exit(1)
4747
}
4848

49+
fmt.Fprintln(os.Stderr, "Starting Codex CLI login...")
50+
fmt.Fprintln(os.Stderr, "If a browser window does not open, copy the URL from the output below.")
51+
fmt.Fprintln(os.Stderr)
52+
4953
cmd := exec.Command(codexPath, "login")
5054
cmd.Stdin = os.Stdin
5155
cmd.Stdout = os.Stdout
5256
cmd.Stderr = os.Stderr
57+
// Inherit full environment so DISPLAY/WAYLAND_DISPLAY are available
58+
// for browser opening on Linux.
59+
cmd.Env = os.Environ()
5360

5461
if err := cmd.Run(); err != nil {
5562
if exitErr, ok := err.(*exec.ExitError); ok {

0 commit comments

Comments
 (0)