I'd like to run a remote bash shell that is fully interactive.
The client side should be able to send commands to this bash process and get the outputs interactively.
This means that, just like in a local bash prompt, the correlation between commands and their respected responses isn't necessarily guaranteed, since we may get outputs from a previous command that runs in the background, after running another command.
It works when I run separate bash process and use pipes:
bash 2>&1 | tee file
bash > file 2>&1
However, if I need to send control characters like Tab for auto-completion or Ctrl+C, in case we want to terminate the current command.
It may sound similar to SSH protocol, but I'd like to experiment with this option of running an alternative remote shell, with different access control and UI experience.
So, my question is: How do I pass the control character to the remote bash process (for example, the auto-completion) and get back the results (for example, list of choices for auto-completion)?
NOTE: I don't wish to develop bash equivalent shell script, but just build a proxy process that is able to pass both data and control characters and provide seamless bash experience as in local /ssh mode.