Open FromWau opened 5 months ago
Wrap url with '. → Internal command: xdg-open 'url'
'
Example: We want to search for packages (eg: anyrun) in the aur that are not outdated (url: https://aur.archlinux.org/packages?K=anyrun&outdated=off)
user input: anyrun resulting internal string: https://aur.archlinux.org/packages?K=anyrun&outdated=off resulting internal command: xdg-open https://aur.archlinux.org/packages?K=anyrun&outdated=off
anyrun
https://aur.archlinux.org/packages?K=anyrun&outdated=off
xdg-open https://aur.archlinux.org/packages?K=anyrun&outdated=off
running in bash:
we see that the pages opens but &... disappeared. Wrapping the url fixes this:
&...
xdg-open 'https://aur.archlinux.org/packages?K=anyrun&outdated=off'
Fixes #1
By the way this would have an issue with URLs that have a ' in it, for example if you want to wrap your search query in 's...
xdg-open 'https://yourfav.site/page?q=foo+'{}'&bar=baz'
This fixes the problem that bash escapes the url string.
Wrap url with
'
. → Internal command: xdg-open 'url'Why the wrap?
Example: We want to search for packages (eg: anyrun) in the aur that are not outdated (url: https://aur.archlinux.org/packages?K=anyrun&outdated=off)
user input:
anyrun
resulting internal string:https://aur.archlinux.org/packages?K=anyrun&outdated=off
resulting internal command:xdg-open https://aur.archlinux.org/packages?K=anyrun&outdated=off
running in bash:
we see that the pages opens but
&...
disappeared. Wrapping the url fixes this:Fixes #1