From: Michael Prokop Date: Fri, 3 Dec 2021 09:21:11 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/github/pr/130' X-Git-Tag: v0.19.1~4 X-Git-Url: https://git.grml.org/?a=commitdiff_plain;h=71d9deccfa42338806229f048f75248859d100a0;hp=da239bb6fb273bd66d806c3049a352dfad6276cf;p=grml-etc-core.git Merge remote-tracking branch 'origin/github/pr/130' --- diff --git a/doc/grmlzshrc.t2t b/doc/grmlzshrc.t2t index c44f2e0..9016cea 100644 --- a/doc/grmlzshrc.t2t +++ b/doc/grmlzshrc.t2t @@ -100,6 +100,10 @@ A value of zero turns off checking. : **NOCOR** Non zero values deactivate automatic correction of commands. +: **NOETCHOSTS** +Non zero values deactivate parsing of "/etc/hosts" disabling host completion +using file's contents. + : **NOMENU** If set to zero (default), allows selection from a menu, if there are at least five possible options of completion. diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 8ac9d7d..8ff4dde 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -481,6 +481,7 @@ setopt unset # 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 @@ 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)~~"$(