zsh-users
 help / color / mirror / code / Atom feed
* Re: known hosts tab completion
@ 2012-06-22 18:48 Matt Woodson
  2012-06-23 18:18 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Matt Woodson @ 2012-06-22 18:48 UTC (permalink / raw)
  To: zsh-users; +Cc: d.s

I am reviving this question from a few months ago.  I have asked this
question on stack exchange, and didn't get any answers.  I am really
hoping someone here can help me out.

http://unix.stackexchange.com/questions/35483/zsh-host-name-completion-behaviour-change

I have been using ZSH to do host name completion, and want to change
the default behaviour. When I have multiple hosts with similar names,
the completion does stuff that I don't care for. An example is best:

Let's say I have these hosts:

host01.stage.example.com
host02.stage.example.com
host01.prod.example.com
host02.prod.example.com

now, in my prompt, I will type:

$ ssh hos<tab>

zsh will show me:

$ ssh host..example.com

with the cursor right after "host" and shows me a menu with the host
names in it. I like the menu showing me hostnames, I just don't want
it to complete everything. Weird things happen. Most of the time I tab
through and either have to delete host names or have extra stuff on
the line i have to delete.

A preferred way would be to not complete the rest of the hostname.
something like:

$ ssh hos<tab>

zsh would hopefully show me:

$ ssh host
host01.stage.example.com  host01.prod.example.com
host02.stage.example.com  host02.prod.example.com

I have also noticed when i start putting in host names like:

host-server01.stg.example.com
host-server01.prod.example.com

and I do my "ssh host<tab>", it will take me to the subdomain first.

All i really want is this to complete like normal completion, and not
dance around on me.  Any thoughts?


^ permalink raw reply	[flat|nested] 6+ messages in thread
* known hosts tab completion
@ 2012-04-04  7:58 Daniel Shahaf
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Shahaf @ 2012-04-04  7:58 UTC (permalink / raw)
  To: zsh-users

(4.3.15, FreeBSD port. I already tried manpages and IRC.)

In ~/.ssh/config I have three hosts: foo.tld foo-1.tld foo-2.tld

At a new prompt, under 'zsh -f; autoload compinit; compinit', 
I type:   ssh foo<tab>

I get:    ssh foo<cursor>.tld

What I want to do: complete to 'foo.tld' and move to the end of the
input line, in order enter a command (e.g., 'ssh foo.tld <cursor>'
in order to run 'ssh foo.tld date')

I don't see how to do that.

I see two workarounds: (a) press <tab> three times, to cycle through the
completions once; (b) 'setopt MENU_COMPLETE' (but that loses me
the ability to complete an unambiguous prefix (namely, 'cd ~/d<tab>' ->
'cd ~/do<cursor>' when ~/docs and ~/dots exist), which is a deal breaker
for me).

As to possible solutions, I'd be happy with something that doesn't fill
the ".tld" part to the right of the cursor, as then I could just type
'.<tab>' to get what I want (with the trailing space, even).

Pointers, please?


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-06-24  8:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-22 18:48 known hosts tab completion Matt Woodson
2012-06-23 18:18 ` Bart Schaefer
2012-06-23 18:28   ` Mikael Magnusson
2012-06-24  8:39     ` Daniel Shahaf
2012-06-23 22:48   ` Matt Woodson
  -- strict thread matches above, loose matches on Subject: below --
2012-04-04  7:58 Daniel Shahaf

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).