Ensure that $BROWSER runs omarchy-launch-browser and doesn't hand ownership to parent process

This prevents gh auth login from working without an existing open
browser
This commit is contained in:
David Heinemeier Hansson
2026-05-15 16:07:35 +02:00
parent daf301c416
commit 43134875b5
3 changed files with 18 additions and 2 deletions
+11
View File
@@ -0,0 +1,11 @@
echo "Set BROWSER to Omarchy browser launcher for detached terminal URL opens"
if [[ -f ~/.config/uwsm/default ]]; then
if grep -q '^export BROWSER=' ~/.config/uwsm/default; then
sed -i 's|^export BROWSER=.*|export BROWSER=omarchy-launch-browser|' ~/.config/uwsm/default
else
printf '\n# Used by terminal programs (like gh) to open URLs detached from the terminal process tree\nexport BROWSER=omarchy-launch-browser\n' >> ~/.config/uwsm/default
fi
else
omarchy-refresh-config uwsm/default
fi