fix wait key command for posix shells
This commit is contained in:
parent
c19d3450a2
commit
3d1b090359
10
app.go
10
app.go
@ -16,7 +16,15 @@ type App struct {
|
|||||||
func waitKey() error {
|
func waitKey() error {
|
||||||
// TODO: this should be done with termbox somehow
|
// 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.Stdin = os.Stdin
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
|
Loading…
Reference in New Issue
Block a user