From 4c74462763308dc5076e71d254d5a03d809d4726 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 28 May 2022 11:29:09 +0530 Subject: [PATCH] ssh kitten: Look in common locations for login shell if it is not in PATH --- shell-integration/ssh/bootstrap-utils.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/shell-integration/ssh/bootstrap-utils.sh b/shell-integration/ssh/bootstrap-utils.sh index c3cf8a036..d623a9418 100644 --- a/shell-integration/ssh/bootstrap-utils.sh +++ b/shell-integration/ssh/bootstrap-utils.sh @@ -198,6 +198,20 @@ prepare_for_exec() { install_kitty_bootstrap [ -n "$login_shell" ] || using_getent || using_id || using_python || using_perl || using_passwd || using_shell_env || login_shell="sh" + case "$login_shell" in + /*) ;; + *) + if ! command -v "$login_shell" > /dev/null 2> /dev/null; then + for i in /opt/homebrew/bin /opt/homebrew/sbin /usr/local/bin /usr/bin /bin /usr/sbin /sbin + do + if [ -x "$i/$login_shell" ]; then + login_shell="$i/$login_shell" + break; + fi + done + fi + ;; + esac shell_name=$(command basename $login_shell) [ -n "$login_cwd" ] && cd "$login_cwd" }