From 9d0cd87023c4cf83cbef704cb644d79734dd8f8d Mon Sep 17 00:00:00 2001 From: Luca Di Maio Date: Mon, 11 Mar 2024 18:25:24 +0100 Subject: [PATCH] enter: fix shell when entering initful container after Fix #1275 Signed-off-by: Luca Di Maio --- distrobox-enter | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/distrobox-enter b/distrobox-enter index 84dbb7741c..777001dce0 100755 --- a/distrobox-enter +++ b/distrobox-enter @@ -77,7 +77,7 @@ headless=0 [ "$(id -ru)" -eq 0 ] && rootful=1 || rootful=0 skip_workdir=0 verbose=0 -version="1.7.0" +version="1.7.0.1" # Source configuration files, this is done in an hierarchy so local files have # priority over system defaults @@ -333,6 +333,10 @@ generate_command() { container_command_login="${container_command_login} --pty" fi container_command_login="${container_command_login} -c \"\\\$(getent passwd ${USER} | cut -f 7 -d :) -l\"" + if [ -n "${container_command}" ]; then + container_command="$(echo "${container_command}" | sed 's/\$/\\\$/g')" + container_command="${container_command_login} -c \"${container_command}\"" + fi else result_command="${result_command} --user=\"${USER}"\"