Merge remote-tracking branch 'origin/github/pr/130'
authorMichael Prokop <mika@grml.org>
Fri, 3 Dec 2021 09:21:11 +0000 (10:21 +0100)
committerMichael Prokop <mika@grml.org>
Fri, 3 Dec 2021 09:21:11 +0000 (10:21 +0100)
1  2 
etc/zsh/zshrc

diff --combined etc/zsh/zshrc
@@@ -481,6 -481,7 +481,7 @@@ setopt unse
  
  # setting some default values
  NOCOR=${NOCOR:-0}
+ NOETCHOSTS=${NOETCHOSTS:-0}
  NOMENU=${NOMENU:-0}
  NOPRECMD=${NOPRECMD:-0}
  COMMAND_NOT_FOUND=${COMMAND_NOT_FOUND:-0}
@@@ -893,7 -894,7 +894,7 @@@ function grmlcomp () 
      if is42 ; then
          [[ -r ~/.ssh/config ]] && _ssh_config_hosts=(${${(s: :)${(ps:\t:)${${(@M)${(f)"$(<$HOME/.ssh/config)"}:#Host *}#Host }}}:#*[*?]*}) || _ssh_config_hosts=()
          [[ -r ~/.ssh/known_hosts ]] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
-         [[ -r /etc/hosts ]] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
+         [[ -r /etc/hosts ]] && [[ "$NOETCHOSTS" -eq 0 ]] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
      else
          _ssh_config_hosts=()
          _ssh_hosts=()
      alias l='command ls -l'
  fi
  
 +# use ip from iproute2 with color support
 +if ip --color=auto addr >/dev/null 2>&1; then
 +    alias ip='command ip --color=auto'
 +fi
 +
  if [[ -r /proc/mdstat ]]; then
      alias mdstat='cat /proc/mdstat'
  fi
@@@ -3312,14 -3308,7 +3313,14 @@@ zrcautoload lookupinit && lookupini
  # variables
  
  # set terminal property (used e.g. by msgid-chooser)
 -export COLORTERM="yes"
 +case "${COLORTERM}" in
 +  truecolor)
 +    # do not overwrite
 +    ;;
 +  *)
 +    export COLORTERM="yes"
 +    ;;
 +esac
  
  # aliases