mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
fix ssh autocompletion to ignore port info from knonw_hosts files
This commit is contained in:
parent
757fa3314d
commit
dabd9b8901
1 changed files with 1 additions and 1 deletions
|
|
@ -32,7 +32,7 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir
|
||||||
cdpath=(.)
|
cdpath=(.)
|
||||||
|
|
||||||
# use /etc/hosts and known_hosts for hostname completion
|
# use /etc/hosts and known_hosts for hostname completion
|
||||||
[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_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 ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
|
||||||
hosts=(
|
hosts=(
|
||||||
"$_ssh_hosts[@]"
|
"$_ssh_hosts[@]"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue