Menu

#83 Host Name Completion Needs Updating

feature_requests
open
nobody
Completion (18)
5
2012-10-31
2012-10-31
Anonymous
No

Host name completion is extremely frustrating in ZSH when dealing with similar names in work environments. I do not believe there is a way to change the default behavior, so I am reporting this here. I have posted on the zsh mailing list with no help, so I am posting this here asking for a way for this to change.

Problem:

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

<tab> = me hitting tab
| = cursor position

I TYPE:

$ ssh hos<tab>

ZSH SHOWS:

$ ssh host.|.example.com

with the cursor right after "host" and shows me a menu with the host
names in it. I then continue to type "stage"

$ ssh host.stage<tab>.example.com

and I am presented this mess:

$ ssh host|.stage.example.com.example.com

I then type this in (hopefully it will fix itself):

$ ssh host01<tab>.stage.example.com.example.com

and I get a bigger mess:

$ ssh host01.|.example.com.stage.example.com.example.com

I type this:

$ ssh host01.stage<tab>.example.com.stage.example.com.example.com

and I get this:

$ ssh host01.stage.example.com |.example.com.stage.example.com.example.com

A control-k takes care of it at this point, but it's a much longer process than it needs to be.

============================
Potential solutions.

1. Change the way it tab completes entirely, and by default something like this:

A preferred way would be to not complete the rest of the host name.
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

2. If people still prefer the way I described above, provide an option to enable default tab completion (as described in #1)

Discussion

  • Anonymous

    Anonymous - 2012-10-31
    • summary: Hostname Completion Needs Updating --> Host name Completion Needs Updating
     
  • Anonymous

    Anonymous - 2012-10-31
    • summary: Host name Completion Needs Updating --> Host Name Completion Needs Updating
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.