From 4db1ee53efc7481b689ebee69b5381d63fe59419 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 20 Dec 2020 02:49:54 +0100 Subject: 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. --- browserenv_unix.go | 1 + 1 file changed, 1 insertion(+) (limited to 'browserenv_unix.go') 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) } -- cgit v1.2.3