From b5b0d6b3ead5d4d65367b57aac5d879975714cd9 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 23 May 2024 08:47:38 +0900 Subject: [PATCH] Do not run as winpty proxy if winpty is not available --- src/core.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core.go b/src/core.go index 9c5ac033..f0728f80 100644 --- a/src/core.go +++ b/src/core.go @@ -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 {