Handle case of tty not being OK
This commit is contained in:
parent
405c472d13
commit
704717ff1d
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
saved_tty_settings=""
|
saved_tty_settings=""
|
||||||
tdir=""
|
tdir=""
|
||||||
|
shell_integration_dir=""
|
||||||
cleanup_on_bootstrap_exit() {
|
cleanup_on_bootstrap_exit() {
|
||||||
[ -n "$saved_tty_settings" ] && command stty "$saved_tty_settings" 2> /dev/null < /dev/tty
|
[ -n "$saved_tty_settings" ] && command stty "$saved_tty_settings" 2> /dev/null < /dev/tty
|
||||||
[ -n "$tdir" ] && command rm -rf "$tdir"
|
[ -n "$tdir" ] && command rm -rf "$tdir"
|
||||||
@ -399,6 +400,7 @@ exec_bash_with_integration() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exec_with_shell_integration() {
|
exec_with_shell_integration() {
|
||||||
|
[ -z "$shell_integration_dir" ] && return
|
||||||
case "$shell_name" in
|
case "$shell_name" in
|
||||||
"zsh")
|
"zsh")
|
||||||
exec_zsh_with_integration
|
exec_zsh_with_integration
|
||||||
@ -415,6 +417,7 @@ exec_with_shell_integration() {
|
|||||||
execute_sh_with_posix_env() {
|
execute_sh_with_posix_env() {
|
||||||
[ "$shell_name" = "sh" ] || return # only for sh as that is likely to be POSIX compliant
|
[ "$shell_name" = "sh" ] || return # only for sh as that is likely to be POSIX compliant
|
||||||
command "$login_shell" -l -c ":" > /dev/null 2> /dev/null && return # sh supports -l so use that
|
command "$login_shell" -l -c ":" > /dev/null 2> /dev/null && return # sh supports -l so use that
|
||||||
|
[ -z "$shell_integration_dir" ] && die "Could not read data over tty ssh kitten cannot function"
|
||||||
sh_dir="$shell_integration_dir/sh"
|
sh_dir="$shell_integration_dir/sh"
|
||||||
command mkdir -p "$sh_dir" || die "Creating $sh_dir failed";
|
command mkdir -p "$sh_dir" || die "Creating $sh_dir failed";
|
||||||
sh_script="$sh_dir/login_shell_env.sh"
|
sh_script="$sh_dir/login_shell_env.sh"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user