diff --git a/open.go b/open.go index 2518745..caada1c 100644 --- a/open.go +++ b/open.go @@ -6,6 +6,7 @@ import ( "fmt" "os/exec" "runtime" + "strings" ) var openCommands = map[string][]string{ @@ -19,6 +20,9 @@ func Open(uri string) error { if !ok { return fmt.Errorf("don't know how to open things on %s platform", runtime.GOOS) } + if runtime.GOOS == "windows" { + uri = strings.Replace(uri, "&", "^&", -1) + } run = append(run, uri) cmd := exec.Command(run[0], run[1:]...) return cmd.Start()