Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

Any thoughts?

share|improve this question

migrated from stackoverflow.com Apr 1 '12 at 17:17

This question came from our site for professional and enthusiast programmers.

1 Answer 1

did you change anything in your .zshrc file ? Because when I do

ssh 127<tab>

it gives me correct suggestions... the cursor goes at the right place:

ssh 127.0.<cursor>.1
127.0.0.1 127.0.1.1

(the second line is the suggestions get)

share|improve this answer
    
PinkFloyd, this is exactly the behavior that the OP described that he/she wanted to get rid of. –  jayhendren Oct 3 '13 at 22:34
    
@jayhendren not it's not –  Kiwy Feb 14 at 13:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.