From c19d64c3555539e706f78e23bdb830ae42432e74 Mon Sep 17 00:00:00 2001 From: Chris La Date: Tue, 17 Mar 2026 09:26:58 -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 --- openhands/wrapper/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openhands/wrapper/main.go b/openhands/wrapper/main.go index fe8e91a..f80497e 100644 --- a/openhands/wrapper/main.go +++ b/openhands/wrapper/main.go @@ -46,10 +46,17 @@ func cmdSetup() { os.Exit(1) } + fmt.Fprintln(os.Stderr, "Starting OpenHands 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(openhandsPath, "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 {