Coding style.
- Add comments for termios features.
This commit is contained in:
parent
ae07f1cab3
commit
3e145fc5e4
1 changed files with 3 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue