Address review comments by @Konfekt

d4216b0dcc
This commit is contained in:
Junegunn Choi 2024-05-23 21:14:08 +09:00
parent 3dee8778d0
commit d9b5c9b2be
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -6,6 +6,7 @@ import (
"fmt" "fmt"
"os" "os"
"os/exec" "os/exec"
"strings"
"github.com/junegunn/fzf/src/util" "github.com/junegunn/fzf/src/util"
) )
@ -27,7 +28,7 @@ func needWinpty(opts *Options) bool {
We're not going to worry too much about restoring the original value. We're not going to worry too much about restoring the original value.
*/ */
if os.Getenv("MSYS") == "enable_pcon" { if strings.Contains(os.Getenv("MSYS"), "enable_pcon") {
opts.Height = heightSpec{} opts.Height = heightSpec{}
return false return false
} }
@ -37,10 +38,10 @@ func needWinpty(opts *Options) bool {
// os.Setenv("MSYS", "enable_pcon") // os.Setenv("MSYS", "enable_pcon")
return true return true
} }
if _, err := exec.LookPath("winpty"); err != nil { if opts.NoWinpty {
return false return false
} }
if opts.NoWinpty { if _, err := exec.LookPath("winpty"); err != nil {
return false return false
} }
return true return true