Skip to content
Advertisement

Run interactive Bash with popen and a dedicated TTY Python

I need to run an interactive Bash instance in a separated process in Python with it’s own dedicated TTY (I can’t use pexpect). I used this code snippet I commonly see used in similar programs:

JavaScript

But when I run it I get the following output:

JavaScript

Strace of the run shows some errors:

JavaScript

The code snippet seems pretty straightforward, is Bash not getting something it needs? what could be the problem here?

Advertisement

Answer

This is the solution that worked for me at the end (as suggested by qarma) :

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement