fix wait key command for posix shells

This commit is contained in:
Gokcehan 2016-08-28 16:58:24 +03:00
parent c19d3450a2
commit 3d1b090359

10
app.go
View File

@ -16,7 +16,15 @@ type App struct {
func waitKey() error {
// TODO: this should be done with termbox somehow
cmd := exec.Command(gOpts.shell, "-c", "echo; echo -n 'Press any key to continue'; stty -echo; read -n 1; stty echo; echo")
c := `echo
echo -n 'Press any key to continue'
old=$(stty -g)
stty raw -echo
eval "ignore=\$(dd bs=1 count=1 2> /dev/null)"
stty $old
echo`
cmd := exec.Command(gOpts.shell, "-c", c)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout