简体   繁体   中英

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 process. 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 (eg 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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM