From: Alexander Barton Date: Tue, 24 Nov 2020 11:46:58 +0000 (+0100) Subject: Don't use $HOSTNAME or call hostname(1), use $HOST instead! X-Git-Url: https://arthur.barton.de/gitweb/?p=ax-zsh.git;a=commitdiff_plain;h=8b85237b61a26e2afda556b72859268ee6c9e5ed Don't use $HOSTNAME or call hostname(1), use $HOST instead! --- diff --git a/bin/axttyinfo b/bin/axttyinfo index 57c76c0..6efd51d 100755 --- a/bin/axttyinfo +++ b/bin/axttyinfo @@ -20,7 +20,7 @@ while [[ $# -gt 0 ]]; do shift done -print -Pn -- "$fg[white]$FX[bold]$(hostname)$FX[no-bold] " +print -Pn -- "$fg[white]$FX[bold]$HOST$FX[no-bold] " print -Pn -- "$fg[yellow]$(tty)$FX[reset], " print -Pn -- "$fg[green]$FX[underline]${TERM:-?}$FX[reset] " print -Pn -- "(${COLUMNS:-?}x${LINES:-?}); " diff --git a/core/11_terminal/11_terminal.zshrc b/core/11_terminal/11_terminal.zshrc index 33dafb1..ac5a1fc 100644 --- a/core/11_terminal/11_terminal.zshrc +++ b/core/11_terminal/11_terminal.zshrc @@ -97,7 +97,7 @@ function axzsh_terminal_title_precmd { if [[ "$TERM_PROGRAM" == "Apple_Terminal" && "$TERM" != "screen"* ]]; then axzsh_terminal_set_icon_title "$LOGNAME@$SHORT_HOST" # Update CWD in Terminal.app - local url=$(echo "file://$HOSTNAME$PWD" | sed -e 's| |%20|g') + local url=$(echo "file://$HOST$PWD" | sed -e 's| |%20|g') printf '\e]7;%s\a' "$url" else axzsh_terminal_set_icon_title "$LOGNAME@$SHORT_HOST:$PWD" diff --git a/core/30_hostname/30_hostname.zprofile b/core/30_hostname/30_hostname.zprofile index 5b2dbd3..e2d0699 100644 --- a/core/30_hostname/30_hostname.zprofile +++ b/core/30_hostname/30_hostname.zprofile @@ -1,8 +1,8 @@ # AX-ZSH: Alex' Modular ZSH Configuration # 30_hostname.zprofile: Initialize hostname settings -# Setup "HOSTNAME" variable -[[ -z "$HOSTNAME" ]] && HOSTNAME=$( hostname ) +# Setup legacy "HOSTNAME" variable (use "HOST"!) +[[ -z "$HOSTNAME" ]] && HOSTNAME="$HOST" export HOSTNAME # Setup "SHORT_HOST" variable