Do not run as winpty proxy if winpty is not available

This commit is contained in:
Junegunn Choi 2024-05-23 08:47:38 +09:00
parent a90426b7ca
commit b5b0d6b3ea
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -3,6 +3,7 @@ package fzf
import (
"os"
"os/exec"
"sync"
"time"
@ -25,7 +26,9 @@ func Run(opts *Options) (int, error) {
}
if os.Getenv("TERM_PROGRAM") == "mintty" && !opts.NoWinpty {
return runWinpty(os.Args, opts)
if _, err := exec.LookPath("winpty"); err == nil {
return runWinpty(os.Args, opts)
}
}
if err := postProcessOptions(opts); err != nil {