Skip to content

Commit

Permalink
enter: fix regression in tty detection. Fix #971
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Di Maio <[email protected]>
  • Loading branch information
89luca89 committed Sep 16, 2023
1 parent 8ee3c50 commit 10a91dc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion distrobox-enter
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ if [ -z "${container_name}" ]; then
container_name="${container_name_default}"
fi

if [ ! -t 0 ] || [ ! -t 1 ]; then
headless=1
fi
# We depend on a container manager let's be sure we have it
# First we use podman, else docker, else lilipod
case "${container_manager}" in
Expand Down Expand Up @@ -300,7 +303,7 @@ generate_command() {
# To work around this, --headless let's you skip the --tty flag and make it
# work in tty-less situations.
# Disable tty also if we're NOT in a tty (test -t 0, test -t 1).
if [ "${headless}" -eq 0 ] && [ -t 0 ] && [ -t 1 ]; then
if [ "${headless}" -eq 0 ]; then
result_command="${result_command}
--tty"
fi
Expand Down

0 comments on commit 10a91dc

Please sign in to comment.