zsh-users
 help / color / mirror / code / Atom feed
* [newbie] bash-like feature - autocompletion problem
@ 2003-01-24 18:57 Petre Bandac
       [not found] ` <11265.1043664899@finches.logica.co.uk>
  2003-01-29 23:02 ` Deborah Ariel Pickett
  0 siblings, 2 replies; 3+ messages in thread
From: Petre Bandac @ 2003-01-24 18:57 UTC (permalink / raw)
  To: ZSH User List

hello

I have switched to zsh with the installation of a freebsd workstation @ home; 
among others, I have the following problem:

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'

I'm using

[petre@kgb]$ zsh --version                                                    
zsh 4.0.6 (i386-portbld-freebsd4.7)


where and what should I modify ?

thanks,

petre


-- 
Login: petre          			Name: Petre Bandac
Directory: /home/petre              	Shell: /usr/local/bin/zsh
On since Fri Jan 24 10:25 (EET) on ttyv0, idle 10:21 (messages off)
On since Fri Jan 24 10:40 (EET) on ttyp0, idle 0:12, from :0
On since Fri Jan 24 11:24 (EET) on ttyp1, idle 0:32, from :0
On since Fri Jan 24 17:57 (EET) on ttyp2, idle 0:38, from :0
On since Fri Jan 24 18:35 (EET) on ttyp3, idle 2:09, from :0
On since Fri Jan 24 19:00 (EET) on ttyp4, idle 0:13, from :0
No Mail.
No Plan.


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

* Re: [newbie] bash-like feature - autocompletion problem
       [not found]   ` <200301272332.12295.petre@kgb.ro>
@ 2003-01-29 10:47     ` Oliver Kiddle
  0 siblings, 0 replies; 3+ messages in thread
From: Oliver Kiddle @ 2003-01-29 10:47 UTC (permalink / raw)
  To: Petre Bandac; +Cc: zsh-users

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.


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

* Re: [newbie] bash-like feature - autocompletion problem
  2003-01-24 18:57 [newbie] bash-like feature - autocompletion problem Petre Bandac
       [not found] ` <11265.1043664899@finches.logica.co.uk>
@ 2003-01-29 23:02 ` Deborah Ariel Pickett
  1 sibling, 0 replies; 3+ messages in thread
From: Deborah Ariel Pickett @ 2003-01-29 23:02 UTC (permalink / raw)
  To: petre; +Cc: ZSH User List

> I have switched to zsh with the installation of a freebsd workstation @ home; 
> among others, I have the following problem:
> 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'
> I'm using
> [petre@kgb]$ zsh --version                                                    
> zsh 4.0.6 (i386-portbld-freebsd4.7)
> where and what should I modify ?

Here's a little fragment of my .zshrc:

    zstyle ':completion:*' hosts `\
      [[ -f ~/.hosts ]] &&
        sed 's/ .*$//' < ~/.hosts;
      [[ -f ~/.rhosts ]] &&
        sed 's/ .*$//' < ~/.rhosts`

The whole bit between the `...` is just a sed script which grabs
hostnames from various files.  The newer (non-compctl) zsh completion
system seems to make use of a style.  If you don't set that style with a
zstyle command, zsh can't guess what your hosts are.  It seems that zsh
doesn't pick any files by default for a list of hostnames.

I'd say that in your situation you'd want to do something like

    zstyle ':completion:*' hosts `cat /etc/hosts`

(or fancier versions which I'm sure others here will suggest that don't
use cat or sed) in your .zshrc.

Let me know how it goes.

-- 
Debbie Pickett http://www.csse.monash.edu.au/~debbiep debbiep@csse.monash.edu.au
 "Beaujolais goes straight to my head, beaujolais puts me to shame, And I don't
  know why I'm in this place or how I came." - _Beaujolais_, The Alan Parsons
                                    Project


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

end of thread, other threads:[~2003-01-29 23:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-24 18:57 [newbie] bash-like feature - autocompletion problem Petre Bandac
     [not found] ` <11265.1043664899@finches.logica.co.uk>
     [not found]   ` <200301272332.12295.petre@kgb.ro>
2003-01-29 10:47     ` Oliver Kiddle
2003-01-29 23:02 ` Deborah Ariel Pickett

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