Currently, we just forward the TERM variable into the container. This
breaks, if the user uses a terminal emulator on the host that misses the
terminfo inside the container (like foot). Then, tools like kas menu or
bitbake fail to start.
To mitigate this, we check in the container entrypoint if we have the
terminfo for that terminal. If not, we fall back to xterm, as nearly all
terminal emulators implement a superset of xterm.
Reported-by: Michael Adler <
michae...@siemens.com>
Signed-off-by: Felix Moessbauer <
felix.mo...@siemens.com>
---
container-entrypoint | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/container-entrypoint b/container-entrypoint
index 927248db7..b9514a445 100755
--- a/container-entrypoint
+++ b/container-entrypoint
@@ -54,6 +54,11 @@ may also need to update the host distribution (e.g. Debian Jessie -> Stretch).
EOF
fi
+# if the container is started from a not supported terminal, fallback to xterm
+if [ -n "$TERM" ]; then
+ infocmp "$TERM" > /dev/null || TERM=xterm
+fi
+
if [ -z "$USER_ID" ] || [ "$USER_ID" = 0 ]; then
# Not a kas-container call, or we shall run everything as root
GOSU=""
--
2.50.0