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 committed 2017-06-03 19:47:53 +09:00
1 parent f4731c0514
commit ca0b3b6fd7
3 files changed
+34 -22

No files matched your search

+1 -5
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