fix(wsl): provide xdg-open so browser-based logins work #108

Merged
lyrathorpe merged 1 commits from fix/wsl-xdg-open into main 2026-08-28 13:53:39 +01:00
Owner

WSL has no xdg-open and no Linux browser, so anything that shells out to one fails:

exec: "xdg-open,x-www-browser,www-browser": executable file not found in $PATH

Hit today by kubelogin in interactive mode — which matters because that is the mode the shared cluster kubeconfig uses, and the mode now documented for re-authenticating after a PIM activation.

Ships an xdg-open on PATH that hands the URL to Windows through powershell.exe -Command Start-Process, falling back to explorer.exe, and points $BROWSER at it for tools that read the variable rather than calling xdg-open.

wslu (wslview) is the conventional answer and was my first attempt. It has been removed from nixpkgs: 'wslu' has been removed because the project has been discontinued and the repository has been archived.

Scoped to users/emmathorpe/work.nix, so the EDaaS/WSL host only. Verified the equivalent shell one-liner opens a Windows browser from this box; emmathorpe-edaas toplevel evaluates, nix fmt clean.

WSL has no `xdg-open` and no Linux browser, so anything that shells out to one fails: ``` exec: "xdg-open,x-www-browser,www-browser": executable file not found in $PATH ``` Hit today by `kubelogin` in `interactive` mode — which matters because that is the mode the shared cluster kubeconfig uses, and the mode now documented for re-authenticating after a PIM activation. Ships an `xdg-open` on PATH that hands the URL to Windows through `powershell.exe -Command Start-Process`, falling back to `explorer.exe`, and points `$BROWSER` at it for tools that read the variable rather than calling `xdg-open`. `wslu` (`wslview`) is the conventional answer and was my first attempt. It has been removed from nixpkgs: *'wslu' has been removed because the project has been discontinued and the repository has been archived*. Scoped to `users/emmathorpe/work.nix`, so the EDaaS/WSL host only. Verified the equivalent shell one-liner opens a Windows browser from this box; `emmathorpe-edaas` toplevel evaluates, `nix fmt` clean.
lyrathorpe added 1 commit 2026-08-28 13:49:05 +01:00
fix(wsl): provide xdg-open so browser-based logins work
CI / flake (push) Skipped
CI / flake (pull_request) Successful in 4m30s
a51ed76119
WSL has no xdg-open and no Linux browser, so anything that shells out to one
fails with:

  exec: "xdg-open,x-www-browser,www-browser": executable file not found in $PATH

kubelogin's interactive login hits this, which matters because interactive is
the mode the shared cluster kubeconfig uses and the mode documented for
re-authenticating after a PIM activation.

Ships an xdg-open on PATH that hands the URL to Windows via powershell.exe,
falling back to explorer.exe, and points $BROWSER at it for tools that read the
variable instead of calling xdg-open. wslu would be the conventional answer but
has been removed from nixpkgs after upstream archived the project.
lyrathorpe scheduled this pull request to auto merge when all checks succeed 2026-08-28 13:50:11 +01:00
lyrathorpe merged commit a587f0ab71 into main 2026-08-28 13:53:39 +01:00
lyrathorpe deleted branch fix/wsl-xdg-open 2026-08-28 13:53:40 +01:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lyrathorpe/nixfiles#108