I start socat on a terminal by executing socat - UNIX-listen:/tmp/sock
Then I go to another terminal and start a program (by python) in such a way, that it appears to run in the first terminal, here is an example:
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
s.connect("/tmp/sock")
proc=subprocess.Popen(['prg'], stdin=s, stdout=s, stderr=s, shell=False)
proc.wait()
Programs with simple input/output like "cat" for example are working fine, but more complex ones (like "vim" or "bash") are not very happy, obviously. Beside of that, when I hit Cntrl-C on the first terminal, the socat is killed, while I would prefer the keyboard interrupt to be delivered to the prg program (started in the python code above).
My question is: if it's possible and how to tell it to socat to behave like the prg is the terminal owner and not socat itself.
PS. It might appear that this question is a duplicate of this one, but it's not the case, because in that question the prg is called directly by socat, so it is possible to use EXEC options.