zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: hostname completion for ssh / scp
Date: Sun, 6 Nov 2016 09:41:52 -0800	[thread overview]
Message-ID: <161106094152.ZM20287@torch.brasslantern.com> (raw)
In-Reply-To: <581EEEB3.3070003@gmx.ch>

On Nov 6,  9:49am, Fourhundred Thecat wrote:
}
} > On 2016-11-05 23:53, Bart Schaefer wrote:
} > 
} > zstyle -e ':completion:*:(ssh|scp):*:my-accounts' users-hosts \
} > 	'_hosts "$@"; trap false EXIT; return 1' 
} 
} But it's only using /etc/hosts, and not ~/.ssh/config.

There has been a small change to ssh-config parsing in 5.something,
but nothing that would make it miss the file entirely.

Note that _ssh stores the hosts it finds in $_cache_hosts, so it may
not work to add the above style to a running zsh where you have tried
ssh host completions before.  "unset _cache_hosts" or restart zsh.

If it still seems not to be working, try:

    ssh s<c-x ?>

That is, control-x question-mark, which invokes _complete_debug.  This
will write a file in /tmp with a backtrace of the completion process.

If you then do:

    grep '\+_ssh_hosts' /tmp/zsh$$ssh? | less

You should be able to see ~/.ssh/config being parsed.  This will most
likely show you what's going on.


  reply	other threads:[~2016-11-06 17:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-03 19:11 Fourhundred Thecat
2016-11-05  4:42 ` Bart Schaefer
2016-11-05  8:55   ` Fourhundred Thecat
2016-11-05 17:24     ` Bart Schaefer
2016-11-05 18:54       ` Fourhundred Thecat
2016-11-05 20:29         ` Bart Schaefer
2016-11-05 20:54           ` Fourhundred Thecat
2016-11-05 22:53           ` Bart Schaefer
2016-11-06  8:49             ` Fourhundred Thecat
2016-11-06 17:41               ` Bart Schaefer [this message]
     [not found]       ` <581E2AE5.4040006__46101.1380576112$1478372966$gmane$org@gmx.ch>
2016-11-05 20:31         ` Daniel Shahaf
2016-11-05 20:50           ` Fourhundred Thecat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=161106094152.ZM20287@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).