Skip to content

Instantly share code, notes, and snippets.

@winny-
Created Aug 5, 2021
Embed
What would you like to do?
# borrowed from https://github.com/microsoft/ptvsd/issues/1423
import sys
import termios
import tty
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
tty.setraw(fd)
ch = sys.stdin.read(1)
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment