#!/bin/sh # Host-shell bridge for the agent's PTY console. # # The wrapper sets SHELL=/app/bin/host-shell, so the agent's PTY console # spawns this instead of a sandboxed shell. flatpak-spawn --host (requires # --talk-name=org.freedesktop.Flatpak) runs the command on the host with the # PTY fds forwarded, giving the remote console a real host login shell. # # The inner resolution runs ON THE HOST: flatpak-spawn forwards the sandbox # environment, so $SHELL would still point at this script — resolve the user's # real login shell from passwd instead and fix up $SHELL before exec'ing it. exec flatpak-spawn --host /bin/sh -c ' shell="$(getent passwd "$(id -un)" | cut -d: -f7)" [ -x "$shell" ] || shell=/bin/sh export SHELL="$shell" exec "$shell" -l '