mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
Fix SSH hostname on Linux
This commit is contained in:
parent
f0fdf1d4f0
commit
a241377632
2 changed files with 20 additions and 2 deletions
11
zsh/prompt
11
zsh/prompt
|
|
@ -131,8 +131,17 @@ set_prompt() {
|
|||
|
||||
local buffer=""
|
||||
|
||||
local hostname=""
|
||||
if [[ -n $HOST ]]; then
|
||||
hostname="${HOST%.local}"
|
||||
elif [[ -n $HOSTNAME ]]; then
|
||||
hostname="${HOSTNAME}"
|
||||
else
|
||||
hostname="$(hostname -s)"
|
||||
fi
|
||||
|
||||
if [[ -n $SSH_CLIENT ]]; then
|
||||
buffer="${buffer}${HOST%.local} "
|
||||
buffer="${buffer}${hostname} "
|
||||
fi
|
||||
|
||||
if [[ -n $STY ]]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue