Fix cursor keys not working in some terminals.

This commit is contained in:
Andrew Hamilton 2021-04-27 15:22:31 +10:00
parent ce8ac8f6e1
commit b1efb0ff28

View file

@ -71,6 +71,7 @@ def interactive():
new_settings[3] = new_settings[3] & ~termios.ECHO & ~termios.ICANON
new_settings[6][termios.VMIN] = 0
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, new_settings)
sys.stdout.write(ESC + "[?1l") # Ensure normal cursor key codes
try:
yield
finally: