aaemnnosttv/wp-cli-login-command

Customize --launch browser

Closed this issue · 2 comments

Log1x commented

Does there happen to be a way to configure the --launch browser? Right now, it attempts to use xdg-open to launch www-browser on my Windows 10's Linux Subsystem but I'd rather it just use firefox.exe or detect an environment variable of what my default browser executable is.

Error: /usr/bin/xdg-open: 771: /usr/bin/xdg-open: www-browser: not found
/usr/bin/xdg-open: 771: /usr/bin/xdg-open: links2: not found
/usr/bin/xdg-open: 771: /usr/bin/xdg-open: elinks: not found
/usr/bin/xdg-open: 771: /usr/bin/xdg-open: links: not found
/usr/bin/xdg-open: 771: /usr/bin/xdg-open: lynx: not found
/usr/bin/xdg-open: 771: /usr/bin/xdg-open: w3m: not found

You can set the WP_CLI_LOGIN_LAUNCH_WITH environment variable to override the binary used to launch the URL :)

Log1x commented

Thanks!

export WP_CLI_LOGIN_LAUNCH_WITH="/mnt/c/Program\ Files/Mozilla\ Firefox/firefox.exe" did the trick. sh wasn't able to find firefox.exe in my PATH but using the full directory worked despite being a little ugly.

sh seems to return a blank Error: for whatever reason but it works nonetheless. 😄

Screenshot