Add support for opening an existing PTY

Virtual machine monitor programs (e.g. QEMU, Cloud Hypervisor) expose
guest consoles as PTYs.  With this patch, foot can access these guest
consoles.

Usually, the program used for accessing these PTYs is screen, but
screen is barely developed, doesn't support resizing, and has a bunch
of other unrelated stuff going on.  It would be nice to have a
terminal emulator that properly supported opening an existing PTY.
The VMM controls the master end of the PTY, so to the other end (in
this case foot), it just behaves like any application running in a
directly-opened PTY, and all that's needed is to change foot's code to
support opening an existing PTY rather than creating one.

Co-authored-by: tanto <tanto@ccc.ac>
This commit is contained in:
Alyssa Ross 2021-12-10 17:40:59 +00:00 committed by Daniel Eklöf
parent 712bc95db3
commit 86894a1cd2
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
9 changed files with 76 additions and 32 deletions

View file

@ -78,6 +78,13 @@ the foot command line
*-L*,*--login-shell*
Start a login shell, by prepending a '-' to argv[0].
*--pty*
Display an existing pty instead of creating one. This is useful
for interacting with VM consoles.
This option is not currently supported in combination with
*-s*,*--server*.
*-D*,*--working-directory*=_DIR_
Initial working directory for the client application. Default:
_CWD of foot_.