Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh does not offer ssh host from config
- X-seq: zsh-workers 51178
- From: Jan Palus <jpalus@xxxxxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: zsh does not offer ssh host from config
- Date: Sat, 10 Dec 2022 21:06:02 +0100
- Archived-at: <https://zsh.org/workers/51178>
- Feedback-id: i01894241:Fastmail
- In-reply-to: <CAN=4vMrpAh7ChTOobqhvE6ioNiWVr40+juSQaKe48OVZsYOjrg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <20221209010650.sq2cp5a2op2mrpat@pine.grzadka> <CAN=4vMrpAh7ChTOobqhvE6ioNiWVr40+juSQaKe48OVZsYOjrg@mail.gmail.com>
On 10.12.2022 13:08, Roman Perepelitsa wrote:
> On Fri, Dec 9, 2022 at 2:07 AM Jan Palus <jpalus@xxxxxxxxxxxx> wrote:
> >
> > Hi,
> >
> > I've got a single real hostname starting with 'build' prefix which is present
> > in my known_hosts file. I also have a couple Host specifications in ssh config
> > file having names starting with 'build' but real HostName does not resolve to
> > name starting with 'build'. When doing `ssh build<tab>` I'd expect to be
> > offered both real hostname as well as Host specification names, however only
> > real hostname is immediately completed.
>
> If you only ever ssh to hosts listed in the ssh config, you can
> configure ssh completions to respect that:
>
> zstyle ':completion:*:(ssh|scp):*:hosts' hosts
>
> Listing all remote machines in the ssh config has other advantages
> besides making completions more predictable.
In my case it's much more practical to ie use pattern in ssh config for
all the test envs instead of listing plenty of them explicitly.
It's nice to have a possibility to customize behavior but I'd say more
sensible default would be to offer both. Or in other words current
default behavior is somewhat counter-intuitive. Doing "build<tab>"
offers single completion, while doing more specific "builder<tab>"
offers 3. Intuitively with every char completion options should be
narrowed (or remain the same) but should not be broadened.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author