From 3e145fc5e45db60a95452598206c76b7b0be7e7a Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Tue, 4 Jan 2022 18:25:43 +1000 Subject: [PATCH] Coding style. - Add comments for termios features. --- fill3/fill3/terminal.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fill3/fill3/terminal.py b/fill3/fill3/terminal.py index 9ea641d..856bf6b 100644 --- a/fill3/fill3/terminal.py +++ b/fill3/fill3/terminal.py @@ -70,9 +70,10 @@ def alternate_buffer(): def raw(): old_termios_settings = termios.tcgetattr(sys.stdin) new_settings = termios.tcgetattr(sys.stdin) - new_settings[0] = new_settings[0] & ~termios.IXON + new_settings[0] = new_settings[0] & ~termios.IXON # ctrl-s doesn't freeze output + # Don't print keys typed. Read byte by byte. Ctrl-c and ctrl-z aren't special. new_settings[3] = new_settings[3] & ~termios.ECHO & ~termios.ICANON & ~termios.ISIG - new_settings[6][termios.VMIN] = 0 + new_settings[6][termios.VMIN] = 0 # Read unblocks immediately on input termios.tcsetattr(sys.stdin, termios.TCSADRAIN, new_settings) sys.stdout.write(ESC + "[?1l") # Ensure normal cursor key codes try: