Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Ssh completion from ~/.ssh/config
- X-seq: zsh-users 20108
- From: Jesper Nygårds <jesper.nygards@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Ssh completion from ~/.ssh/config
- Date: Tue, 7 Apr 2015 20:37:00 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=MEYoiLu164nQNOotMfF/gfQhI5LASlM3U18JAxpaDEk=; b=n2H1Zj8dljzNyVNv2IRw4v0Lh5Vo9T00jb09wO4ZM/9LqMcS3Enl3Zj+RZmb3RORkF 7kKPDCj6yhPlXukdChloMBIiD7jucHg5CrOe4RerNfC3CWr3Wdg/1j8FhW9hxobKxW0h uMS4oHG22BR0LEi3XM/K01C3CZG9B413TE0sbrQ/umAIcKyjW7GABlqvndmpccT0FfkM d99O8cerFd7Fr1SxDr3Nz/L9rV39SibWquJ4nbrSgs5ZMtQwBPPfch2MdKt+LU2R7zzW kywpz6kdLyRkjk9AjDN2AuqTj4R3mWLv/gwGgoaTG4tI2d4uFbx5ODVdpMfQYqraSjuk 5F4A==
- In-reply-to: <1797284.9M4pHoONQN@note>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CABZhJg-8fQyOsYLHwYKoDx8DxOsReeZzfhtoi5fV_DDUQ-ziZA@mail.gmail.com> <1797284.9M4pHoONQN@note>
Thank you for the tip, Vadim. This solves my problem, in a way.
However, the existing _ssh file already has working code for parsing the
.ssh/config file. Code which is far more readable, and doesn't require me
to parse it myself with that hosts definition. For some reason though,
someone has decided that it is not to be used. I would still prefer it if
there was some way of configuring that I want to use the code that is
already written, and that I prefer .ssh/config over .ssh/known_hosts.
On Tue, Apr 7, 2015 at 4:27 PM, Vadim A. Misbakh-Soloviov <mva@xxxxxxxx>
wrote:
> ```
> # Hostnames completion.
> zstyle -e ':completion:*:hosts' hosts 'reply=(
> ${${${${${(f)"$(<${HOME}/.ssh/known_hosts)"//\[/}//\]:/ }:#[\|]*}%%\
> *}%%,*}
> ${${${(@M)${(f)"$(<${HOME}/.ssh/config)"}:#Host *}#Host }:#*[*?]*}
> ${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}#*[[:blank:]]}}
> )'
> zstyle ':completion:*:*:*:hosts' ignored-patterns 'ip6*' 'localhost*'
>
>
> ```
Messages sorted by:
Reverse Date,
Date,
Thread,
Author