Skip to content

Instantly share code, notes, and snippets.

@winny-
Created August 5, 2021 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save winny-/65ae0a592231a6600f93b90387196a23 to your computer and use it in GitHub Desktop.
Save winny-/65ae0a592231a6600f93b90387196a23 to your computer and use it in GitHub Desktop.
# 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