zsh-users
 help / color / mirror / code / Atom feed
* weird expansion and compctl for man pages
@ 2001-07-03  0:45 Will Yardley
  2001-07-03  0:58 ` Clint Adams
  0 siblings, 1 reply; 2+ messages in thread
From: Will Yardley @ 2001-07-03  0:45 UTC (permalink / raw)
  To: zsh-users

two questions.

i use the following to put the current command in the titlebar:

case $TERM in
        (xterm*)
                precmd () {print -Pn "\e]2;%n@%m  %~ %l %W  %T\a"}
                preexec () {print -Pn "\e]2;%n@%m  $*  %l %W  %T\a"}
        ;;
esac

and the following to expand common hostnames and usernames for ssh:

compctl -k hosts -x 'c[-1,-l]' -k usernames -- \
        + -k usernames -S '@' -x 'n[1,@]' -k hosts -- ssh

when ssh to a particular machine was freezing today, i noticed that if i
hit tab while expanding the hostname, the resulting command which showed
up in the titlebar was:
ssh machine ssh machine ssh machine ssh machine

i realize this isn't a super big deal, but is there an easy way to get
around this?

also i tried some of the various compctl scripts for completing man
pages (including the two on the main info site) and neither seemed to
work (i used the bsd option).  i'm using zsh 4.0.1 on freebsd
4.3-stable.  does anyone have a working script on a similar system? 
basically i want to be able to type:
man
and then tab complete to various programs as long as there's a man page
for them
so man l[tab] would expand to ls, lsof etc.

w


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

* Re: weird expansion and compctl for man pages
  2001-07-03  0:45 weird expansion and compctl for man pages Will Yardley
@ 2001-07-03  0:58 ` Clint Adams
  0 siblings, 0 replies; 2+ messages in thread
From: Clint Adams @ 2001-07-03  0:58 UTC (permalink / raw)
  To: Will Yardley; +Cc: zsh-users

>                 preexec () {print -Pn "\e]2;%n@%m  $*  %l %W  %T\a"}

> ssh machine ssh machine ssh machine ssh machine

Check the docs for preexec.  $* is no longer what you want;
you'll want to replace that with either $1, $2, or $3.

> 4.3-stable.  does anyone have a working script on a similar system? 
> basically i want to be able to type:
> man
> and then tab complete to various programs as long as there's a man page
> for them
> so man l[tab] would expand to ls, lsof etc.

You may want to try out

autoload -U compinstall ; compinstall

and see if that doesn't make your life easier.


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

end of thread, other threads:[~2001-07-03  0:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-03  0:45 weird expansion and compctl for man pages Will Yardley
2001-07-03  0:58 ` Clint Adams

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