From 86894a1cd29f8fb3e5a8487b4ce2d2c1b4cf57a9 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 10 Dec 2021 17:40:59 +0000 Subject: 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 --- completions/bash/foot | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'completions/bash') diff --git a/completions/bash/foot b/completions/bash/foot index eb17dad1..25aa2c49 100644 --- a/completions/bash/foot +++ b/completions/bash/foot @@ -19,6 +19,7 @@ _foot() "--maximized" "--override" "--print-pid" + "--pty" "--server" "--term" "--title" @@ -39,7 +40,7 @@ _foot() for word in "${previous_words[@]}" ; do match=$(printf "$commands" | grep -Fx "$word" 2>/dev/null) if [[ ! -z "$match" ]] ; then - if [[ ${COMP_WORDS[i-1]} =~ ^(--app-id|--config|--font|--log-level|--term|--title|--window-size-pixels|--window-size-chars|--working-directory)$ ]] ; then + if [[ ${COMP_WORDS[i-1]} =~ ^(--app-id|--config|--font|--log-level|--pty|--term|--title|--window-size-pixels|--window-size-chars|--working-directory)$ ]] ; then (( i++ )) continue fi @@ -74,7 +75,7 @@ _foot() COMPREPLY=( $(compgen -W "none error warning info" -- ${cur}) ) ;; --log-colorize|-l) COMPREPLY=( $(compgen -W "never always auto" -- ${cur}) ) ;; - --app-id|--help|--override|--title|--version|--window-size-chars|--window-size-pixels|--check-config|-[ahoTvWwC]) + --app-id|--help|--override|--pty|--title|--version|--window-size-chars|--window-size-pixels|--check-config|-[ahoTvWwC]) # Don't autocomplete for these flags : ;; *) -- cgit v1.3