summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-05-23 21:14:08 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-05-23 21:14:08 +0900
commitd9b5c9b2be50989fdf8d49c3e24e0c06d6aeafcc (patch)
treedf0a6f23b5c4a354e0f620c2a4b4b9e9f22fc7f8 /src
parent3dee8778d073199e0fe1e186e54f7eabc2fdef43 (diff)
downloadfzf-d9b5c9b2be50989fdf8d49c3e24e0c06d6aeafcc.tar.gz
Address review comments by @Konfekt
https://github.com/junegunn/fzf/commit/d4216b0dcc13567479d81cc5ad2adedb1443ea8b
Diffstat (limited to 'src')
-rw-r--r--src/winpty_windows.go7
1 files 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