wrangler login opens a browser window to the Cloudflare dashboard in order to generate a token.
Some folks, like me, have multiple browser profiles. Opening a browser using the default mechanism doesn't necessarily use the correct profile.
Unfortunately, the URL that wrangler login opens seems to immediately redirect to something else, such that if I copy/paste the URL out of the address bar and into the correct browser profile, it doesn't work as expected.
Most tools like this also print the URL to the terminal, so that it can be copy/pasted. It would be great if Wrangler did so as well. It would be especially great if it did so even if I chose "no" when asked "Allow Wrangler to open a page in your browser?"
So I ended up replacing xdg-open on my system with this shell script:
#! /bin/bash
echo -n "$1" | xsel -i -b
echo "URL COPIED: $1"
notify-send "URL Copied" "$1"
TBH I should have done this a LONG time ago! This is just all-around better for me across a lot of programs. Heh.
So I don't need this change anymore but I still think it would be a good idea for others. Most other terminal programs that open browser windows print the URL in my experience.
Hey there! As a WSL user, I came across the same issue just today. I'd love to take a swing at this!
Most helpful comment
So I ended up replacing
xdg-openon my system with this shell script:TBH I should have done this a LONG time ago! This is just all-around better for me across a lot of programs. Heh.
So I don't need this change anymore but I still think it would be a good idea for others. Most other terminal programs that open browser windows print the URL in my experience.