Skip to content

Instantly share code, notes, and snippets.

@silviot
Last active March 5, 2020 12:14
Show Gist options
  • Save silviot/dfa76a928b9295a7d5264fecf43068d2 to your computer and use it in GitHub Desktop.
Save silviot/dfa76a928b9295a7d5264fecf43068d2 to your computer and use it in GitHub Desktop.
Restore sanity to degraded pdb
import logging
import sys
import termios
fd = sys.stdin.fileno()
(iflag, oflag, cflag, lflag, ispeed, ospeed, cc) = termios.tcgetattr(fd)
lflag |= termios.ECHO
new_attr = [iflag, oflag, cflag, lflag, ispeed, ospeed, cc]
termios.tcsetattr(fd, termios.TCSANOW, new_attr)
logging.getLogger().setLevel(logging.ERROR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment