From d9b5c9b2be50989fdf8d49c3e24e0c06d6aeafcc Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 23 May 2024 21:14:08 +0900 Subject: [PATCH] Address review comments by @Konfekt https://github.com/junegunn/fzf/commit/d4216b0dcc13567479d81cc5ad2adedb1443ea8b --- src/winpty_windows.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/winpty_windows.go b/src/winpty_windows.go index 6d7e366f..a9e56bbd 100644 --- a/src/winpty_windows.go +++ b/src/winpty_windows.go @@ -6,6 +6,7 @@ import ( "fmt" "os" "os/exec" + "strings" "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. */ - if os.Getenv("MSYS") == "enable_pcon" { + if strings.Contains(os.Getenv("MSYS"), "enable_pcon") { opts.Height = heightSpec{} return false } @@ -37,10 +38,10 @@ func needWinpty(opts *Options) bool { // os.Setenv("MSYS", "enable_pcon") return true } - if _, err := exec.LookPath("winpty"); err != nil { + if opts.NoWinpty { return false } - if opts.NoWinpty { + if _, err := exec.LookPath("winpty"); err != nil { return false } return true