This commit is contained in:
pagedown 2022-03-07 20:56:02 +08:00
parent cf0cd9acd9
commit 4aea64261e
No known key found for this signature in database
GPG Key ID: E921CF18AC8FF6EB

View File

@ -160,15 +160,13 @@ _ksi_main() {
# connected to most SSH servers # connected to most SSH servers
# or use ssh kitten to connected to some SSH servers that do not set SSH_TTY # or use ssh kitten to connected to some SSH servers that do not set SSH_TTY
_ksi_prompt[hostname_prefix]="\h: " _ksi_prompt[hostname_prefix]="\h: "
else elif [[ -n "$(builtin command -v who)" && "$(builtin command who -m 2> /dev/null)" =~ "\([a-fA-F.:0-9]+\)$" ]]; then
if [[ -n "$(builtin command -v who)" && "$(builtin command who -m 2> /dev/null)" =~ "\([a-fA-F.:0-9]+\)$" ]]; then
# the shell integration script is installed manually on the remote system # the shell integration script is installed manually on the remote system
# the environment variables are cleared after sudo # the environment variables are cleared after sudo
# OpenSSH's sshd creates entries in utmp for every login so use those # OpenSSH's sshd creates entries in utmp for every login so use those
_ksi_prompt[hostname_prefix]="\h: " _ksi_prompt[hostname_prefix]="\h: "
fi fi
fi fi
fi
# see https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html#Controlling-the-Prompt # see https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html#Controlling-the-Prompt
# we use suffix here because some distros add title setting to their bashrc files by default # we use suffix here because some distros add title setting to their bashrc files by default
_ksi_prompt[ps1_suffix]+="\[\e]2;${_ksi_prompt[hostname_prefix]}\w\a\]" _ksi_prompt[ps1_suffix]+="\[\e]2;${_ksi_prompt[hostname_prefix]}\w\a\]"