summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergii Tkachenko <sergiitk@google.com>2025-06-16 07:54:12 -0700
committerGitHub <noreply@github.com>2025-06-16 16:54:12 +0200
commit2fbdfa93f942611c56bb02657a39f577bd7f0ef0 (patch)
tree07bf8e3867049d60389f39e53d5d221ebea5050d
parent042605ee6b2afeb21e380d05b22d5072f0eeff44 (diff)
downloadzsh-2fbdfa93f942611c56bb02657a39f577bd7f0ef0.tar.gz
zsh-2fbdfa93f942611c56bb02657a39f577bd7f0ef0.tar.bz2
zsh-2fbdfa93f942611c56bb02657a39f577bd7f0ef0.zip
fix(init): ensure hostname is always valid for macOS (#13171)
-rw-r--r--oh-my-zsh.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
index 2e885219c..3e547d358 100644
--- a/oh-my-zsh.sh
+++ b/oh-my-zsh.sh
@@ -99,8 +99,8 @@ done
# Figure out the SHORT hostname
if [[ "$OSTYPE" = darwin* ]]; then
- # macOS's $HOST changes with dhcp, etc. Use ComputerName if possible.
- SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || SHORT_HOST="${HOST/.*/}"
+ # macOS's $HOST changes with dhcp, etc. Use LocalHostName if possible.
+ SHORT_HOST=$(scutil --get LocalHostName 2>/dev/null) || SHORT_HOST="${HOST/.*/}"
else
SHORT_HOST="${HOST/.*/}"
fi