You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 28, 2018. It is now read-only.
We were doing a few things wrong:
- The local pty handed out by docker hasn't been configured to do
anything special, it's a "default" canonical terminal with the line
discipline configured to line buffer input, display a local echo and
send signals on ctrl+c, ...
- We had ported a bit of code from runv to locally buffer the input on
top of the above. Unfortunately that wasn't helping and was intended
for something else in runv (telnet client for debugging)
So, the strategy to solve the input with cc-shim is as follow:
- Configure the local pty in raw mode. The goal here is to just
forward the raw content of stdin to the pty allocated for the
process inside the VM. The process inside the VM will have the pty
there configured as it wishes (canonical Vs raw) and we bypass the
treatment of the line discipline on the host side.
- We try to read BUFSIZE data on stdin. In raw mode (pty allocation),
the read() can return with only 1 byte of data, ie. 1 key press.
When using stdin to pipe data to the process, we should benefit from
buffering. I've also removed an unnecessary copy between buf and
wbuf.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
0 commit comments