set stty_settings [exec stty -g]
exec stty raw -echo
puts -nonewline $msg
flush stdout
read stdin 1
exec stty $stty_settings
puts ""
}
puts 1
anykey
puts 2
Another suggestion:
proc pause {{message "Hit Enter to continue ==> "}} {
puts -nonewline $message
flush stdout
gets stdin
}
pause "Hurry, hit enter: "; # Sample usage 1
pause; # Sample usage 2, use default message
沒有留言:
張貼留言