diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2016-11-07 02:15:34 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2016-11-08 02:06:34 +0900 |
commit | 898d8d94c858774b02668c1490068cf086a1f9f0 (patch) | |
tree | 4229f5c2b63b228e8e1e2d1609c3ce587c819162 /src/util | |
parent | 26895da96918f9b1956a04981c8af5f3e42fcbd8 (diff) |
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
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/util_unix.go | 5 | ||||
-rw-r--r-- | src/util/util_windows.go | 13 |
2 files changed, 17 insertions, 1 deletions
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 } |