Skip to content

Run() fails on Windows in Git Bash / Cygwin / MSYS environments #34

Description

@watsonian

We have a CLI tool that runs code like this:

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions