Clean up login shell environment variable earlier
Does not pollute the environment when executing commands.
This commit is contained in:
parent
5c02c370d4
commit
bc9d6892d4
@ -178,12 +178,7 @@ prepare_for_exec() {
|
|||||||
fi
|
fi
|
||||||
[ -f "$HOME/.terminfo/kitty.terminfo" ] || die "Incomplete extraction of ssh data"
|
[ -f "$HOME/.terminfo/kitty.terminfo" ] || die "Incomplete extraction of ssh data"
|
||||||
|
|
||||||
if [ -n "$KITTY_LOGIN_SHELL" ]; then
|
[ -n "$login_shell" ] || using_getent || using_id || using_python || using_perl || using_passwd || using_shell_env || login_shell="sh"
|
||||||
login_shell="$KITTY_LOGIN_SHELL"
|
|
||||||
unset KITTY_LOGIN_SHELL
|
|
||||||
else
|
|
||||||
using_getent || using_id || using_python || using_perl || using_passwd || using_shell_env || login_shell="sh"
|
|
||||||
fi
|
|
||||||
shell_name=$(command basename $login_shell)
|
shell_name=$(command basename $login_shell)
|
||||||
[ -n "$login_cwd" ] && cd "$login_cwd"
|
[ -n "$login_cwd" ] && cd "$login_cwd"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,6 +71,7 @@ EXPORT_HOME_CMD
|
|||||||
[ -z "$USER" ] && USER="$(command whoami 2> /dev/null)"
|
[ -z "$USER" ] && USER="$(command whoami 2> /dev/null)"
|
||||||
|
|
||||||
leading_data=""
|
leading_data=""
|
||||||
|
login_shell=""
|
||||||
login_cwd=""
|
login_cwd=""
|
||||||
|
|
||||||
request_data="REQUEST_DATA"
|
request_data="REQUEST_DATA"
|
||||||
@ -100,6 +101,8 @@ untar_and_read_env() {
|
|||||||
data_dir="$HOME/$KITTY_SSH_KITTEN_DATA_DIR"
|
data_dir="$HOME/$KITTY_SSH_KITTEN_DATA_DIR"
|
||||||
shell_integration_dir="$data_dir/shell-integration"
|
shell_integration_dir="$data_dir/shell-integration"
|
||||||
unset KITTY_SSH_KITTEN_DATA_DIR
|
unset KITTY_SSH_KITTEN_DATA_DIR
|
||||||
|
login_shell="$KITTY_LOGIN_SHELL"
|
||||||
|
unset KITTY_LOGIN_SHELL
|
||||||
login_cwd="$KITTY_LOGIN_CWD"
|
login_cwd="$KITTY_LOGIN_CWD"
|
||||||
unset KITTY_LOGIN_CWD
|
unset KITTY_LOGIN_CWD
|
||||||
compile_terminfo "$tdir/home"
|
compile_terminfo "$tdir/home"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user