Skip to content

Instantly share code, notes, and snippets.

@erasmospunk
Forked from esamattis/.pdbrc
Created March 11, 2013 15:38
Show Gist options
  • Save erasmospunk/5135115 to your computer and use it in GitHub Desktop.
Save erasmospunk/5135115 to your computer and use it in GitHub Desktop.
Python debugger config
# Enable tab completion
import rlcompleter
import pdb
pdb.Pdb.complete = rlcompleter.Completer(locals()).complete
# Sometimes when you do something funky, you may lose your terminal echo. This
# should restore it when spanwning new pdb.
import termios, sys
termios_fd = sys.stdin.fileno()
termios_echo = termios.tcgetattr(termios_fd)
termios_echo[3] = termios_echo[3] | termios.ECHO
termios_result = termios.tcsetattr(termios_fd, termios.TCSADRAIN, termios_echo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment