if err := open.Run(url); err != nil {
utils.Log("Unable to launch a browser")
utils.LogDebugError(err)
}
It works fine in Linux, MacOS and in a Windows command prompt. However, it fails when it executes inside Git Bash (which is essentially a MSYS/Cygwin-like environment). The failure message is "Incorrect function".
My suspicion here is that the Windows implementation simply doesn't work in MSYS/Cygwin-style environments. Simply running start $URL in Git Bash opened up a browser as expected. Also, prefixing the command with winpty worked (which is included with Git Bash by default – see https://github.com/rprichard/winpty).
We have a CLI tool that runs code like this:
It works fine in Linux, MacOS and in a Windows command prompt. However, it fails when it executes inside Git Bash (which is essentially a MSYS/Cygwin-like environment). The failure message is "Incorrect function".
My suspicion here is that the Windows implementation simply doesn't work in MSYS/Cygwin-style environments. Simply running
start $URL
in Git Bash opened up a browser as expected. Also, prefixing the command withwinpty
worked (which is included with Git Bash by default – see https://github.com/rprichard/winpty).