Skip to content

Commit 002e1c4

Browse files
committed
enter: fix enter on fish shell, Fix #1210
Signed-off-by: Luca Di Maio <[email protected]>
1 parent eb21dba commit 002e1c4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

distrobox-enter

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ if { [ -n "${SUDO_USER}" ] || [ -n "${DOAS_USER}" ]; } && [ "$(id -ru)" -eq 0 ];
5555
fi
5656

5757
# Defaults
58-
container_command_prefix="sh -c"
58+
container_command_login="/bin/sh -c \"\\\$(getent passwd ${USER} | cut -f 7 -d :) -l\""
59+
container_command_prefix="/bin/sh -c"
5960
container_command=""
6061
container_image_default="registry.fedoraproject.org/fedora-toolbox:39"
6162
container_manager="autodetect"
@@ -322,8 +323,10 @@ generate_command() {
322323
# and we instantiate a proper pty with it
323324
if [ "${headless}" -eq 0 ]; then
324325
container_command_prefix="su --pty ${USER} -c"
326+
container_command_login="su --pty ${USER}"
325327
else
326328
container_command_prefix="su ${USER} -c"
329+
container_command_login="su ${USER}"
327330
fi
328331
else
329332
result_command="${result_command}
@@ -463,7 +466,7 @@ generate_command() {
463466
# if no command was specified, let's execute a command that will find
464467
# and run the default shell for the user
465468
result_command="${result_command}
466-
${container_command_prefix} \"\\\$(getent passwd ${USER} | cut -f 7 -d :) -l\""
469+
${container_command_login}"
467470
fi
468471

469472
# Return generated command.

0 commit comments

Comments
 (0)