Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #15565: Ensure terminal echo is on after reloader reloads (some…

…thing turns it off on some systems if reload happens while at a pdb prompt). Thanks for the report zimnyx.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15883 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f5b22ed9977d19bc35ed02bcb965c0e0f48ef127 1 parent 775a6e6
@kmtracey kmtracey authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 django/utils/autoreload.py
View
13 django/utils/autoreload.py
@@ -42,6 +42,10 @@
except ImportError:
pass
+try:
+ import termios
+except ImportError:
+ termios = None
RUN_RELOADER = True
@@ -67,7 +71,16 @@ def code_changed():
return True
return False
+def ensure_echo_on():
+ if termios:
+ fd = sys.stdin.fileno()
+ attr_list = termios.tcgetattr(fd)
+ if not attr_list[3] & termios.ECHO:
+ attr_list[3] |= termios.ECHO
+ termios.tcsetattr(fd, termios.TCSANOW, attr_list)
+
def reloader_thread():
+ ensure_echo_on()
while RUN_RELOADER:
if code_changed():
sys.exit(3) # force reload
Please sign in to comment.
Something went wrong with that request. Please try again.