From 2fbdfa93f942611c56bb02657a39f577bd7f0ef0 Mon Sep 17 00:00:00 2001 From: Sergii Tkachenko Date: Mon, 16 Jun 2025 07:54:12 -0700 Subject: [PATCH] fix(init): ensure hostname is always valid for macOS (#13171) --- oh-my-zsh.sh | 4 ++-- 1 file 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