From 981eb11b6df4ed07e4c40bcafd847bf005708564 Mon Sep 17 00:00:00 2001 From: pc-heini Date: Tue, 22 Sep 2026 01:32:51 +0200 Subject: [PATCH] fix(console): pass TERM/COLORTERM through flatpak-spawn --host flatpak-spawn --host does not forward the caller's environment; the host login shell started without TERM (tput errors, integer test on empty LINES/COLUMNS in the profile scripts). Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_018jkHZhr7ZzHGGuE2bJQmGa --- host-shell.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/host-shell.sh b/host-shell.sh index 129a6d2..da5bc02 100755 --- a/host-shell.sh +++ b/host-shell.sh @@ -15,7 +15,10 @@ # controlling terminal, tools that open /dev/tty break). script(1) allocates a # second, host-side PTY for the shell and relays through the forwarded one; # util-linux >= 2.35 also passes window-size changes along. -exec flatpak-spawn --host /bin/sh -c ' +# flatpak-spawn --host does not forward the caller's environment: without +# --env the host shell starts with no TERM at all (login scripts then fail +# in tput and in integer tests on the empty LINES/COLUMNS). +exec flatpak-spawn --host --env=TERM="${TERM:-xterm-256color}" --env=COLORTERM=truecolor /bin/sh -c ' shell="$(getent passwd "$(id -un)" | cut -d: -f7)" [ -x "$shell" ] || shell=/bin/sh export SHELL="$shell"