EXEC_CMD must come after login_shell detection since it can use login_shell

This commit is contained in:
Kovid Goyal
2022-03-04 10:00:12 +05:30
parent 64d6337612
commit e0c984046c
2 changed files with 9 additions and 8 deletions

View File

@@ -213,6 +213,14 @@ execute_with_python() {
return 1;
}
LOGIN_SHELL="OVERRIDE_LOGIN_SHELL"
if [ -n "$LOGIN_SHELL" ]; then
login_shell="$LOGIN_SHELL"
else
using_getent || using_id || using_python || using_passwd || die "Could not detect login shell";
fi
shell_name=$(basename $login_shell)
# If a command was passed to SSH execute it here
EXEC_CMD
@@ -224,13 +232,6 @@ if [ "$tty_ok" = "n" ]; then
fi
fi
LOGIN_SHELL="OVERRIDE_LOGIN_SHELL"
if [ -n "$LOGIN_SHELL" ]; then
login_shell="$LOGIN_SHELL"
else
using_getent || using_id || using_python || using_passwd || die "Could not detect login shell";
fi
shell_name=$(basename $login_shell)
exec_bash_with_integration() {
export ENV="$shell_integration_dir/bash/kitty.bash"