From 85c6d8f16e1729227329015936c61571ac77c803 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 6 Mar 2022 12:20:06 +0530 Subject: [PATCH] More robust check for exec -a support --- shell-integration/ssh/bootstrap.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/shell-integration/ssh/bootstrap.sh b/shell-integration/ssh/bootstrap.sh index 0f67f8597..8e788acb2 100644 --- a/shell-integration/ssh/bootstrap.sh +++ b/shell-integration/ssh/bootstrap.sh @@ -338,9 +338,6 @@ esac # We need to pass the first argument to the executed program with a leading - # to make sure the shell executes as a login shell. Note that not all shells # support exec -a so we use the below to try to detect such shells -if [ -z "$PIPESTATUS$pipestatus" ]; then - # the dash shell does not support exec -a and also does not define PIPESTATUS - execute_with_python - exec $login_shell "-l" -fi -exec -a "-$shell_name" $login_shell +[ "$(exec -a echo echo OK 2> /dev/null)" = "OK" ] && exec -a "-$shell_name" $login_shell +execute_with_python +exec $login_shell "-l"