diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2017-01-11 21:48:36 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2017-01-11 21:48:36 +0900 |
| commit | f8082bc53a5bc736558d5952a34b527f12815878 (patch) | |
| tree | a41964fd908edf8f4c00c796d7fdd45a44ba4a67 /src | |
| parent | 996dcb14a3fae6a640bff072149352cd82fd8392 (diff) | |
| download | fzf-f8082bc53a5bc736558d5952a34b527f12815878.tar.gz | |
No need to use /bin/sh to execute stty and tput
Diffstat (limited to 'src')
| -rw-r--r-- | src/tui/light.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tui/light.go b/src/tui/light.go index b9e90d68..4725ef56 100644 --- a/src/tui/light.go +++ b/src/tui/light.go @@ -3,6 +3,7 @@ package tui import ( "fmt" "os" + "os/exec" "strconv" "strings" "syscall" @@ -104,7 +105,7 @@ func NewLightRenderer(theme *ColorTheme, forceBlack bool, mouse bool, tabstop in } func (r *LightRenderer) defaultTheme() *ColorTheme { - colors, err := util.ExecCommand("tput colors").Output() + colors, err := exec.Command("tput", "colors").Output() if err == nil && atoi(strings.TrimSpace(string(colors)), 16) > 16 { return Dark256 } @@ -112,7 +113,7 @@ func (r *LightRenderer) defaultTheme() *ColorTheme { } func (r *LightRenderer) stty(cmd string) string { - proc := util.ExecCommand("stty " + cmd) + proc := exec.Command("stty", cmd) proc.Stdin = r.ttyin out, err := proc.Output() if err != nil { @@ -485,7 +486,7 @@ func (r *LightRenderer) mouseSequence(sz *int) Event { } func (r *LightRenderer) Pause() { - r.stty(fmt.Sprintf("%q", r.ostty)) + r.stty(r.ostty) r.csi("?1049h") r.flush() } @@ -524,7 +525,7 @@ func (r *LightRenderer) Close() { r.csi("A") } r.flush() - r.stty(fmt.Sprintf("%q", r.ostty)) + r.stty(r.ostty) } func (r *LightRenderer) MaxX() int { |
