answered
2015-02-22 16:27:21 +0300
t-lo 4384 ●51 ●61 ●63
It's your python code that does this. From the youtube video I assume that you're trying to run "Striker" (e.g. https://github.com/SkyeSweeney/Striker/). Looking at the striker code it's pretty straightforward why your terminal stops echoing - the code tells the terminal to do so.
We start with looking ar "StrikerMonitor.py", https://github.com/SkyeSweeney/Striker/blob/master/StrikerMonitor.py:
- the main entry point is in line 30, the
main()
function main()
function will call linuxcrt.set_curses_term()
in line 34
We're now in the file "linuxcrt.py", https://github.com/SkyeSweeney/Striker/blob/master/linuxcrt.py:
- in line 15-16, the file descriptor for standard input is acquired, and current terminal settings are read (into
new_term
) - then, the "CANONICAL" and "ECHO" bits are removed (tilde
~
operator) from the terminal settings in new_term
in line 20.
==> Removing the "ECHO" bit causes your problem. - finally, the new settings are applied to the current terminal in
set_curses_term()
in line 28
You can test by just running this condensed python code, it causes the same behaviour:
>>> import sys, termios
>>> fd = sys.stdin.fileno()
>>> new_term = termios.tcgetattr(fd)
>>> new_term[3] = (new_term[3] & ~termios.ICANON & ~termios.ECHO)
>>> termios.tcsetattr(fd, termios.TCSAFLUSH, new_term)
However, I have no Idea why it should have worked before.