From 898d8d94c858774b02668c1490068cf086a1f9f0 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 7 Nov 2016 02:15:34 +0900 Subject: Fix issues in tcell renderer and Windows build - Fix display of CJK wide characters - Fix horizontal offset of header lines - Add support for keys with ALT modifier, shift-tab, page-up and down - Fix util.ExecCommand to properly parse command-line arguments - Fix redraw on resize - Implement Pause/Resume for execute action - Remove runtime check of GOOS - Change exit status to 2 when tcell failed to start - TBD: Travis CI build for tcell renderer - Pending. tcell cannot reliably ingest keys from tmux send-keys --- src/util/util_unix.go | 5 +++++ src/util/util_windows.go | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src/util') diff --git a/src/util/util_unix.go b/src/util/util_unix.go index dcc5cb5e..29e0d30d 100644 --- a/src/util/util_unix.go +++ b/src/util/util_unix.go @@ -15,3 +15,8 @@ func ExecCommand(command string) *exec.Cmd { } return exec.Command(shell, "-c", command) } + +// IsWindows returns true on Windows +func IsWindows() bool { + return false +} diff --git a/src/util/util_windows.go b/src/util/util_windows.go index a660f39e..3aa86606 100644 --- a/src/util/util_windows.go +++ b/src/util/util_windows.go @@ -5,6 +5,8 @@ package util import ( "os" "os/exec" + + "github.com/junegunn/go-shellwords" ) // ExecCommand executes the given command with $SHELL @@ -13,5 +15,14 @@ func ExecCommand(command string) *exec.Cmd { if len(shell) == 0 { shell = "cmd" } - return exec.Command(shell, "/c", command) + args, _ := shellwords.Parse(command) + allArgs := make([]string, len(args)+1) + allArgs[0] = "/c" + copy(allArgs[1:], args) + return exec.Command(shell, allArgs...) +} + +// IsWindows returns true on Windows +func IsWindows() bool { + return true } -- cgit v1.2.3