From 906c3ec2220da8044eb57b8d980fc1cd44fd3436 Mon Sep 17 00:00:00 2001 From: Chris La Date: Tue, 17 Mar 2026 09:26:54 -0700 Subject: [PATCH] Improve setup login: add browser hint and inherit env - 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 so DISPLAY/WAYLAND_DISPLAY are available for browser opening on Linux Co-Authored-By: Claude Opus 4.6 --- codex/wrapper/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/codex/wrapper/main.go b/codex/wrapper/main.go index 484927a..e93a21f 100644 --- a/codex/wrapper/main.go +++ b/codex/wrapper/main.go @@ -46,10 +46,17 @@ func cmdSetup() { os.Exit(1) } + fmt.Fprintln(os.Stderr, "Starting Codex CLI 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(codexPath, "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 {