diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2017-06-03 19:47:53 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2017-06-03 19:47:53 +0900 |
commit | ca0b3b6fd7517aaedcb7517804e2040a8a7aad95 (patch) | |
tree | 611c006836b95a92f60abf054b3670630425b6a7 /src | |
parent | f4731c05142aed1881ced2178c71cbbce4bd1be4 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/tui/tcell.go | 4 | ||||
-rw-r--r-- | src/util/util_windows.go | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/tui/tcell.go b/src/tui/tcell.go index e66ed2f0..0c80de2b 100644 --- a/src/tui/tcell.go +++ b/src/tui/tcell.go @@ -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() diff --git a/src/util/util_windows.go b/src/util/util_windows.go index 1bf8f7aa..efd19a2a 100644 --- a/src/util/util_windows.go +++ b/src/util/util_windows.go @@ -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 |