Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ssh host completion
- X-seq: zsh-users 23268
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: John Benninghoff <john.benninghoff@xxxxxxxxx>
- Subject: Re: ssh host completion
- Date: Thu, 22 Mar 2018 01:26:43 +0100
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1521678414; bh=H4IgO0BNAwh++VlDty89PK8flh7EZbRBa4zHOh+8Who=; h=From:References:To:Subject:Date:From:Subject; b=GPzthmliRvIvzuftehGEBS5SC4UIyme9nvIr1SQNQ4m69n5hhd5pPllrAtNwB9iNB+DM/8AsW/nbYtjgDeXrB8GbaXjs1QrrTdmdneCrc1bPBFDx653w3LCUHesRIwBq3YXpB1aVc9HmMhrR/nZPTKFPbOwgMW5NAf8IC5pjwf9g/9uQ98Aa96iq/a9+HvWIneMOhk1HVhZkkcxyE8KHE6bCEXXTL/DLRVM5uqV2oIaeLfTupwMzXo/WNbwNw6IzRnrOTVljXlq9uyFOFB/9+8P28+++F8jsR/8wDEPVjA8W10nZ7rnjCeqKLct+l2kW3ntysqFDd94eeab7yrZrIw==
- In-reply-to: <CAOYnHSbb_x5aN-A+9apGdX3kd0eEZiifGPH9jndUuuBLMEYeCA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAOYnHSbb_x5aN-A+9apGdX3kd0eEZiifGPH9jndUuuBLMEYeCA@mail.gmail.com>
On 27 Feb, John Benninghoff wrote:
> the host names configured in my ~/.ssh/config file. I use the following
> section in my .zshrc file to try to get the desired behavior:
>
> if [[ -r ~/.ssh/config ]]; then
> sconf=( $(sed -n '/^Host[=\t ]/{s///;s/#.*//;p;}' ~/.ssh/config) )
> zstyle ':completion::complete:ssh:argument-1:' tag-order !users
> zstyle ':completion::*:ssh:*:' hosts $sconf
I think the context for this zstyle won't match. Try something like:
zstyle ':completion::*:ssh:*:hosts' hosts $sconf
or perhaps just:
zstyle ':completion::*:ssh:*' hosts $sconf
If that doesn't help, try experimenting with the users-hosts style. That
needs a context like ':completion:*:ssh:*:my-accounts'. It also expects
usernames in the style values.
> # Use ^Xh to see context and tags applicable in CLI position
Also useful is ^X? to do a full trace. If you view the trace with less,
filtering it with & can be very useful.
> :completion::complete:ssh:argument-1: !users
A similar but slightly different option is to just hide the users:
zstyle ':completion:*:ssh:*:users' hidden true
Sorry that your message didn't get answered sooner.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author