Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [newbie] bash-like feature - autocompletion problem



On 27 Jan, Petre Bandac wrote:
> 
> those are the files - I guess :-)
> 
> On Monday 27 January 2003 12:54 Anno Domini, Oliver Kiddle wrote using one of his keyboards:
> } On 24 Jan, you wrote:
> } > on my linux machine (bash-2.5) I have added one entry in /etc/hosts
> } > stating 192.168.0.1 host1 - which helped me when ssh-ing (just typing=
>  ssh
> } > root@h[TAB]
> } >
> } > and I got the host1 completed)
> } >
> } > here, using zsh, I tried to do the same, but I get something like:
> } >
> } > [petre@kgb]$ more /etc/hosts | grep cockeru
> } >
> } > 192.168.108.176          cockeru
> } > [petre@kgb]$ ssh root@coc
> } >
> } > No matches for: `remote host name', `host', or `corrections'
> }
> } It ought to work on zsh without you doing anything. You couldn't send me
> } your /etc/hosts file by any chance? Have you set a hosts zstyle?
> }
> } > where and what should I modify ?
> }
> } Normallu, for ssh, I use something like:
> } zstyle ':completion:*:(ssh|scp):*:my-accounts' users-hosts root@host1

> Content-Disposition: attachment; filename=".zshrc"
> 
> #
> # Example .zshrc file for zsh 4.0
> #

> # Hosts to use for completion (see later zstyle)
> hosts=(`hostname` ftp.math.gatech.edu prep.ai.mit.edu wuarchive.wustl.edu)

> zstyle '*' hosts $hosts

These two lines in your .zshrc are the reason. The hosts style here
tells zsh's hosts completion to ignore /etc/hosts and complete the
listed hosts instead. If you want it to use /etc/hosts, try removing at
least the second of those lines.

The example .zshrc wasn't really intended to be just picked up and used
after changing nothing more than the prompt.

Oliver

This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.



Messages sorted by: Reverse Date, Date, Thread, Author