Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ssh host completion
- X-seq: zsh-users 23273
- From: John Benninghoff <john.benninghoff@xxxxxxxxx>
- To: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- Subject: Re: ssh host completion
- Date: Sat, 24 Mar 2018 21:05:47 -0700
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=BXzXoUIUBI0NOoR3nt/q0r2I0oTms1q7faG8h9gsaC0=; b=vN0NDeiEv0uKarQpVjcG7NOxJXcAP6Jm86i11H5DS+s8R9QsANjEAtfO6lO/1rhIkz DjMwj3MdCgIMWwAsey85cmLrFPedngqWfnGEimLUpj7TFdCJk1G8pbi96vaxKDP2U/D4 a05iN2bfCb4ZAUnEu96Ofts8ABRE8QMGNLawof/JqfLRliK/o0fx1LkwK0gHqn5pGCxA xrsgXwdmMDBUMyi0YRPUVwvg8edicrY6QxzqW+C0gS2Z6E/x/RH3xcSJ5ThlrMaI6/QY ivmYVlVmMIV02RFATZZ4Jg0A9vz2fsOineC3gAjz3is6w8ZfBmMevgYeuyJX9k8BOe7M HavQ==
- In-reply-to: <25763.1521678403@thecus>
- 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> <25763.1521678403@thecus>
Thanks, the first context suggestion worked.
/John
On Wed, Mar 21, 2018 at 5:26 PM, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> 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