m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 00:03:39 -05:00

Fixes for Cygwin

- Update install script to download Windows binary if $TERM == cygwin
- Unset TERM if $TERM == cygwin (#933)
- Always use cmd.exe instead of $SHELL when running commands
This commit is contained in:
Junegunn Choi
2017-06-03 19:47:53 +09:00
parent f4731c0514
commit ca0b3b6fd7
3 changed files with 34 additions and 22 deletions

View File

@@ -3,6 +3,7 @@
package tui
import (
"os"
"time"
"unicode/utf8"
@@ -140,6 +141,9 @@ func (r *FullscreenRenderer) initScreen() {
}
func (r *FullscreenRenderer) Init() {
if os.Getenv("TERM") == "cygwin" {
os.Setenv("TERM", "")
}
encoding.Register()
r.initScreen()

View File

@@ -12,15 +12,11 @@ import (
// ExecCommand executes the given command with $SHELL
func ExecCommand(command string) *exec.Cmd {
shell := os.Getenv("SHELL")
if len(shell) == 0 {
shell = "cmd"
}
args, _ := shellwords.Parse(command)
allArgs := make([]string, len(args)+1)
allArgs[0] = "/c"
copy(allArgs[1:], args)
return exec.Command(shell, allArgs...)
return exec.Command("cmd", allArgs...)
}
// IsWindows returns true on Windows