开发者

Stty getting insane on using Python subprocess

开发者 https://www.devze.com 2023-04-08 03:55 出处:网络
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.)

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消