Stty getting insane on using Python subprocess
I am facing a weird problem. Every time I call a particular command cmd
via subprocess.Popen(cmd).wait()
, the stty gets bad (does not echo my further commands on the shell, newline does not work, etc.) when the command is over. I have to run stty sane
to get the stty fine again. What could be the reason for this?
Update The command I am running is starting the elasticsearch pro开发者_开发百科cess. The command launches the process in the background.
It's possible that the command you're running is emitting some escape sequences into your terminal that are changing its mode or other settings. Programs that need the full terminal capability do that (e.g. text based editors).
Capturing the standard output of the program you're executing and preventing it from going to the screen might help. Have you tried that?
精彩评论