aboutsummaryrefslogtreecommitdiffstats
path: root/browserenv_unix.go
diff options
context:
space:
mode:
authorTeddy Wing2020-12-20 02:49:54 +0100
committerTeddy Wing2020-12-20 02:52:24 +0100
commit4db1ee53efc7481b689ebee69b5381d63fe59419 (patch)
tree7e833e04e8f69b71228e4100bd6dd29969545130 /browserenv_unix.go
parent3dca44be5342384334020c8f64752caaf86d334d (diff)
downloadbrowserenv-4db1ee53efc7481b689ebee69b5381d63fe59419.tar.bz2
Handle `%s` format string for URL in `BROWSER` variable
The `BROWSER` environment variable might contain a `%s` format string that should be replaced by the URL to open. If it's present perform the replacement. Otherwise, append the URL to the `BROWSER` command as before.
Diffstat (limited to 'browserenv_unix.go')
-rw-r--r--browserenv_unix.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/browserenv_unix.go b/browserenv_unix.go
index e6416f8..e09bd10 100644
--- a/browserenv_unix.go
+++ b/browserenv_unix.go
@@ -21,5 +21,6 @@ func shell() (args []string) {
// TODO
func fmtBrowserCommand(browser, url string) string {
// TODO: handle %s in browser command
+ // TODO: handle single quotes in URL
return fmt.Sprintf("%s '%s'", browser, url)
}