1

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:

  1. bash 2>&1 | tee file
  2. 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.

Zohar81
  • 4,554
  • 5
  • 29
  • 82
  • by default a remote shell (e.g. the remote shell started with `ssh remote`) is already "fully interactive". please elaborate what you want to do. – sexpect - Expect for Shells Jun 13 '22 at 08:42
  • @sexpect-ExpectforShells, I want to create my own remote shell with different access control. my question is how to pass the control characters like Tab for auto-completion, or ctrl+C to kill `top` command. – Zohar81 Jun 16 '22 at 11:25
  • still not clear what you are doing. if you want to create your own *shell* you can first take a look at other shell's source code. – sexpect - Expect for Shells Jun 16 '22 at 15:18
  • @sexpect-ExpectforShells, but I don't want to develop new shell... I just want to be able to pass control characters to existing bash shell. – Zohar81 Jun 16 '22 at 17:52
  • "a proxy process that is able to pass both data and control characters and provide seamless bash experience" — ssh has already done this for you. after you login with ssh the _remote_ bash shell is the just the same as a _local_ bash shell. no? – sexpect - Expect for Shells Jun 17 '22 at 01:19

0 Answers0