|
@@ -57,8 +57,8 @@ def _kb_hold_protect_unix():
|
|
|
# Request 5 bytes to cover escape sequences generated by F1, F2, .. Fn keys (5 bytes)
|
|
|
# as well as UTF8 chars (4 bytes max).
|
|
|
def _get_keypress_unix(prompt='',immed_chars='',prehold_protect=True,num_chars=5):
|
|
|
- fd_err = sys.stderr.fileno()
|
|
|
- os.write(fd_err,prompt.encode())
|
|
|
+ msg_r(prompt)
|
|
|
+ sys.stderr.flush()
|
|
|
timeout = float(0.3)
|
|
|
fd = sys.stdin.fileno()
|
|
|
old = termios.tcgetattr(fd)
|
|
@@ -81,6 +81,7 @@ def _get_keypress_unix(prompt='',immed_chars='',prehold_protect=True,num_chars=5
|
|
|
|
|
|
def _get_keypress_unix_raw(prompt='',immed_chars='',prehold_protect=None,num_chars=5):
|
|
|
msg_r(prompt)
|
|
|
+ sys.stderr.flush()
|
|
|
fd = sys.stdin.fileno()
|
|
|
old = termios.tcgetattr(fd)
|
|
|
tty.setcbreak(fd)
|
|
@@ -90,6 +91,7 @@ def _get_keypress_unix_raw(prompt='',immed_chars='',prehold_protect=None,num_cha
|
|
|
|
|
|
def _get_keypress_unix_stub(prompt='',immed_chars='',prehold_protect=None,num_chars=None):
|
|
|
msg_r(prompt)
|
|
|
+ sys.stderr.flush()
|
|
|
return sys.stdin.read(1).encode()
|
|
|
|
|
|
#_get_keypress_unix_stub = _get_keypress_unix
|