mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 06:36:24 +00:00
Avoid calling who is either of SSH_TTY or SSH2_TTY are defined
This commit is contained in:
parent
0c79561977
commit
e469b46ce5
2 changed files with 14 additions and 4 deletions
|
|
@ -155,7 +155,11 @@ _ksi_main() {
|
|||
fi
|
||||
|
||||
if [[ "${_ksi_prompt[title]}" == "y" ]]; then
|
||||
[[ "$(builtin command who -m 2> /dev/null)" =~ "\([a-fA-F.:0-9]+\)$" ]] && _ksi_prompt[hostname_prefix]="\h: "
|
||||
if [[ -n "$SSH_TTY$SSH2_TTY" ]]; then
|
||||
_ksi_prompt[hostname_prefix]="\h: ";
|
||||
elif [[ -n "$(builtin command -v who)" ]]; then
|
||||
[[ "$(builtin command who -m 2> /dev/null)" =~ "\([a-fA-F.:0-9]+\)$" ]] && _ksi_prompt[hostname_prefix]="\h: ";
|
||||
fi
|
||||
# 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
|
||||
_ksi_prompt[ps1_suffix]+="\[\e]2;${_ksi_prompt[hostname_prefix]}\w\a\]"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue