linux - How to pause a program? -
i want realize pause
function windows shell command pause
. example,
$ go run script.go key continue... //then key continue
on windows, can use system command golang function exec.command()
. how on linux? want use command read -n1 -p "any key continue"
compromised one, doesn't work in function exec.command("read", "-n", "1")
. tested lot failed know why.
besides, know how achieve pause function golang language without using external command?
just read stdin. user have press enter program continue. or set terminal "raw" mode. later case, there's eg. nsf's termbox
Comments
Post a Comment