diff options
| author | Sergii Tkachenko <sergiitk@google.com> | 2025-06-16 07:54:12 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-16 16:54:12 +0200 |
| commit | 2fbdfa93f942611c56bb02657a39f577bd7f0ef0 (patch) | |
| tree | 07bf8e3867049d60389f39e53d5d221ebea5050d | |
| parent | 042605ee6b2afeb21e380d05b22d5072f0eeff44 (diff) | |
| download | zsh-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.sh | 4 |
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 |
