Backstory: I have a CLI Python application. I want to be able to debug it without interfering with the CLI of the main application. The Python debugger allows you to specify an alternative stdin/stdout for the debugger.
I opened a new pane in tmux, and noted down the filename of the pty (/dev/pts/47). I then opened that pty file for reading and writing in Python. This seemed to be going in the right direction. The tmux pane showed some output from the Python debugger and responded to some of the letters I typed, but not all. I assume the problem is that bash is still running in the pty, and some of my input is going to bash, other input is going to Python, depending on which program reads from the pty first.
Is there a way to have tmux/screen/some other application create a pty, but not start a shell so another application can take over the slave side of the pty? Is this likely to work?
Is there another more appropriate way to have a program open a second CLI interface?
(An alternative that I tried is using mkfifo to create two named pipes and then cat >/tmp/pipe_stdin | cat </tmp/pipe_stdout
. This worked but was line-buffered, so line editing doesn't work.)