zsh-users
 help / color / mirror / code / Atom feed
* terminfo, cygwin troubles
@ 2003-01-15 19:33 Le Wang
  2003-01-16 14:27 ` Oliver Kiddle
  2003-01-16 14:40 ` Peter Stephenson
  0 siblings, 2 replies; 10+ messages in thread
From: Le Wang @ 2003-01-15 19:33 UTC (permalink / raw)
  To: Zsh users list

Hi all,

I'm having some trouble with the $TERMINFO variable. 
I've set the variable according to 'man terminfo'. 
But zsh doesn't seem to check my $TERMINFO for the
required descriptors.  Am I missing something?  I know
that it's set correctly since 'man' works correctly
when $TERMINFO is set, but fails when it's not set.

On another note, doing 'ls -F' is really slow on
cygwin.     The zsh completion mechanism seems to do
something very similar to this.  How can I just get
normal menu completion listings without helpful little
symbol suffixes?

On yet another separate note, I have completion set up
to complete file types for specific programs with
little primitive completion scripts like this one:

<file name="_mp3">
#compdef id3cp id3info mp3Reencode mp3Group


local expl
_description files expl 'mp3s'
_files "$expl[@]" -g '*.mp3'
</file>

However this narrows the list too much.  I need any
mp3s or directories, with the mp3s sorted first.  How
would I accomplish this?  (I think this should be
trivial, bit I've never been able to figure it out.)

Thanks in advance.

--
Le

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca


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

* Re: terminfo, cygwin troubles
  2003-01-15 19:33 terminfo, cygwin troubles Le Wang
@ 2003-01-16 14:27 ` Oliver Kiddle
  2003-01-19 23:28   ` Le Wang
  2003-01-16 14:40 ` Peter Stephenson
  1 sibling, 1 reply; 10+ messages in thread
From: Oliver Kiddle @ 2003-01-16 14:27 UTC (permalink / raw)
  To: Le Wang; +Cc: Zsh users list

On 15 Jan, you wrote:

> I'm having some trouble with the $TERMINFO variable. 
> I've set the variable according to 'man terminfo'. 
> But zsh doesn't seem to check my $TERMINFO for the
> required descriptors.  Am I missing something?  I know
> that it's set correctly since 'man' works correctly
> when $TERMINFO is set, but fails when it's not set.

I'm not sure without having access to cygwin. $TERMINFO contains the
directory containing the terminfo database right? It might be using
termcap instead.

> On another note, doing 'ls -F' is really slow on
> cygwin.     The zsh completion mechanism seems to do
> something very similar to this.  How can I just get
> normal menu completion listings without helpful little
> symbol suffixes?

You could try `unsetopt listtypes' but I've no idea if it will help the
speed.

> _files "$expl[@]" -g '*.mp3'

> However this narrows the list too much.  I need any
> mp3s or directories, with the mp3s sorted first.  How
> would I accomplish this?  (I think this should be
> trivial, bit I've never been able to figure it out.)

Generally, that isn't done in the completion function but is configured
by each user. The following style (which is the default in 4.1) may
help. If you want it to work on the mp3 commands only, you'll need to
change the context part.

  zstyle ':completion:*' file-patterns \
      '%p:globbed-files *(-/):directories' '*:all-files'

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] 10+ messages in thread

* Re: terminfo, cygwin troubles
  2003-01-15 19:33 terminfo, cygwin troubles Le Wang
  2003-01-16 14:27 ` Oliver Kiddle
@ 2003-01-16 14:40 ` Peter Stephenson
  2003-01-16 16:22   ` Le Wang
  1 sibling, 1 reply; 10+ messages in thread
From: Peter Stephenson @ 2003-01-16 14:40 UTC (permalink / raw)
  To: Zsh users list

Le Wang wrote:
> I'm having some trouble with the $TERMINFO variable. 
> I've set the variable according to 'man terminfo'. 
> But zsh doesn't seem to check my $TERMINFO for the
> required descriptors.  Am I missing something?  I know
> that it's set correctly since 'man' works correctly
> when $TERMINFO is set, but fails when it's not set.

You will need to restart the shell after setting TERMINFO, since the
shell only examines it when starting up --- thereafter, it recognises
changes to the terminal type, but not to the location of the terminal
database.  Test that this works by starting a subshell after setting the
variable.  If it does work, you could set it in the Windows `environment
variables' dialogue which on XP at least is in the `Advanced' tab of the
system properties.  (I haven't actually tried this.)

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


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

* Re: terminfo, cygwin troubles
  2003-01-16 14:40 ` Peter Stephenson
@ 2003-01-16 16:22   ` Le Wang
  2003-01-16 16:48     ` Le Wang
                       ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Le Wang @ 2003-01-16 16:22 UTC (permalink / raw)
  To: Zsh users list


--- Peter Stephenson <pws@csr.com> wrote:
> Le Wang wrote:

> You will need to restart the shell after setting
> TERMINFO, since the
> shell only examines it when starting up ---
> thereafter, it recognises
> changes to the terminal type, but not to the
> location of the terminal
> database.  Test that this works by starting a
> subshell after setting the
> variable.  If it does work, you could set it in the
> Windows `environment
> variables' dialogue which on XP at least is in the
> `Advanced' tab of the
> system properties.  (I haven't actually tried this.)

I should clarify my problem.  It works fine in
windows, and I run rxvt like so:
"C:\cygwin\bin\rxvt.exe -tn rxvt-cygwin-native -e zsh
--login -i".

However when I ssh into a Linux box, the
'rxvt-cygwin-native' descriptor is only in $TERMINFO,
and I can't get ZSH to look in there to get it.  I set
$TERMINFO in ~/.zshenv, so it might be too late.  I
don't know how I can tell ssh to set it before loading
Zsh...

--
Le

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca


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

* Re: terminfo, cygwin troubles
  2003-01-16 16:22   ` Le Wang
@ 2003-01-16 16:48     ` Le Wang
  2003-01-16 16:48     ` Borzenkov Andrey
  2003-01-16 17:14     ` Oliver Kiddle
  2 siblings, 0 replies; 10+ messages in thread
From: Le Wang @ 2003-01-16 16:48 UTC (permalink / raw)
  To: Zsh users list

--- Le Wang <lewang@yahoo.com> wrote:
> 
> --- Peter Stephenson <pws@csr.com> wrote:
> > Le Wang wrote:
> 
> > You will need to restart the shell after setting
> > TERMINFO, since the
> > shell only examines it when starting up ---
> > thereafter, it recognises
> > changes to the terminal type, but not to the
> > location of the terminal
> > database.  Test that this works by starting a
> > subshell after setting the
> > variable.  If it does work, you could set it in
> the
> > Windows `environment
> > variables' dialogue which on XP at least is in the
> > `Advanced' tab of the
> > system properties.  (I haven't actually tried
> this.)
> 
> I should clarify my problem.  It works fine in
> windows, and I run rxvt like so:
> "C:\cygwin\bin\rxvt.exe -tn rxvt-cygwin-native -e
> zsh
> --login -i".
> 
> However when I ssh into a Linux box, the
> 'rxvt-cygwin-native' descriptor is only in
> $TERMINFO,
> and I can't get ZSH to look in there to get it.  I
> set
> $TERMINFO in ~/.zshenv, so it might be too late.  I
> don't know how I can tell ssh to set it before
> loading
> Zsh...

Okay, I've unset the TERMINFO variable and symlinked
my terminfo directory to ~/.terminfo.  But Zsh still
won't look in there...

Here is another thought: maybe Zsh can be changed to
delay loading the terminfo descriptor until it has to
display something?  This way TERMINFO can be set as
the first thing in ~/.zshenv.  Regardless, ~/.terminfo
should be searched, no?

--
Le

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca


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

* RE: terminfo, cygwin troubles
  2003-01-16 16:22   ` Le Wang
  2003-01-16 16:48     ` Le Wang
@ 2003-01-16 16:48     ` Borzenkov Andrey
  2003-01-16 17:14     ` Oliver Kiddle
  2 siblings, 0 replies; 10+ messages in thread
From: Borzenkov Andrey @ 2003-01-16 16:48 UTC (permalink / raw)
  To: 'Le Wang', 'Zsh users list'

> 
> However when I ssh into a Linux box, the
> 'rxvt-cygwin-native' descriptor is only in $TERMINFO,
> and I can't get ZSH to look in there to get it.  I set
> $TERMINFO in ~/.zshenv, so it might be too late.  I
> don't know how I can tell ssh to set it before loading
> Zsh...
> 

What about it (quoting OpenSSH):

     $HOME/.ssh/environment
             This file is read into the environment at login (if it exists).
             It can only contain empty lines, comment lines (that start with
             `#'), and assignment lines of the form name=value.  The file
             should be writable only by the user; it need not be readable by
             anyone else.


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

* Re: terminfo, cygwin troubles
  2003-01-16 16:22   ` Le Wang
  2003-01-16 16:48     ` Le Wang
  2003-01-16 16:48     ` Borzenkov Andrey
@ 2003-01-16 17:14     ` Oliver Kiddle
  2003-01-16 18:46       ` Le Wang
  2 siblings, 1 reply; 10+ messages in thread
From: Oliver Kiddle @ 2003-01-16 17:14 UTC (permalink / raw)
  To: Le Wang; +Cc: Zsh users list

On 16 Jan, Le Wang wrote:
> 
> However when I ssh into a Linux box, the
> 'rxvt-cygwin-native' descriptor is only in $TERMINFO,
> and I can't get ZSH to look in there to get it.  I set

Is it not possible to add the file you need under the main
/usr/share/terminfo?

> $TERMINFO in ~/.zshenv, so it might be too late.  I
> don't know how I can tell ssh to set it before loading
> Zsh...

In ~/.ssh/environment add a line of the form TERMINFO=value
See the sshd man page for details.

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] 10+ messages in thread

* Re: terminfo, cygwin troubles
  2003-01-16 17:14     ` Oliver Kiddle
@ 2003-01-16 18:46       ` Le Wang
  0 siblings, 0 replies; 10+ messages in thread
From: Le Wang @ 2003-01-16 18:46 UTC (permalink / raw)
  To: Zsh users list

 --- Oliver Kiddle <okiddle@yahoo.co.uk> wrote: > On
16 Jan, Le Wang wrote:
> > 
> > However when I ssh into a Linux box, the
> > 'rxvt-cygwin-native' descriptor is only in
> $TERMINFO,
> > and I can't get ZSH to look in there to get it.  I
> set
> 
> Is it not possible to add the file you need under
> the main
> /usr/share/terminfo?

Yes, I've tried both your suggestions to no avail.  It
doesn't matter where I put the descriptor, it just
won't work.  After some research into terminfo, I
found out that not all terminfo support is created
equal.  Some programs just worked, others (non-curses
programs) required modification of '/etc/termcap'. 
Apparently Zsh is in the latter category.  I added the
termcap entry, and all is well now.

Thanks to all who offered help.

--
Le

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca


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

* Re: terminfo, cygwin troubles
  2003-01-16 14:27 ` Oliver Kiddle
@ 2003-01-19 23:28   ` Le Wang
  2003-01-20 15:55     ` Oliver Kiddle
  0 siblings, 1 reply; 10+ messages in thread
From: Le Wang @ 2003-01-19 23:28 UTC (permalink / raw)
  To: Oliver Kiddle, Zsh users list

 --- Oliver Kiddle <okiddle@yahoo.co.uk> wrote:

> Generally, that isn't done in the completion
> function but is configured
> by each user. The following style (which is the
> default in 4.1) may
> help. If you want it to work on the mp3 commands
> only, you'll need to
> change the context part.
> 
>   zstyle ':completion:*' file-patterns \
>       '%p:globbed-files *(-/):directories'
> '*:all-files'

Yes.  This works well.  But is there any way I can
control how the results are sorted?  I would want the
directories to always come last.

--
Le

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca


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

* Re: terminfo, cygwin troubles
  2003-01-19 23:28   ` Le Wang
@ 2003-01-20 15:55     ` Oliver Kiddle
  0 siblings, 0 replies; 10+ messages in thread
From: Oliver Kiddle @ 2003-01-20 15:55 UTC (permalink / raw)
  To: Le Wang; +Cc: Zsh users list

On 19 Jan, Le Wang wrote:
> >   zstyle ':completion:*' file-patterns \
> >       '%p:globbed-files *(-/):directories'
> > '*:all-files'
> 
> Yes.  This works well.  But is there any way I can
> control how the results are sorted?  I would want the
> directories to always come last.

The group-order style lets you specify the order of the groups. First
you need to add descriptions for the two groups in the file-patterns
style:

zstyle ':completion::*:(id3cp|id3info|mp3Reencode|mp3Group):*' file-patterns \
    '%p:globbed-files:mp3\ files *(-/):directories:directories' '*:all-files'

That avoids the group-name for the files tag taking precedence over
the group-name for the globbed-files and directories tags.

The group-order style is probably unnecessary but here it is anyway:
zstyle ':completion::*:(id3cp|id3info|mp3Reencode|mp3Group):*' group-order \
    globbed-files directories

For this to work you will need to also define a group-name style. I just
define this:
zstyle ':completion:*' group-name ''

but if you don't want that, you can define it for each of the
directories and globbed-files tags:

zstyle ':completion::*:(id3cp|id3info|mp3Reencode|mp3Group):*:directories' \
    group-name directories
zstyle ':completion::*:(id3cp|id3info|mp3Reencode|mp3Group):*:globbed-files' \
    group-name globbed-files

I hope that helps

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] 10+ messages in thread

end of thread, other threads:[~2003-01-20 15:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-15 19:33 terminfo, cygwin troubles Le Wang
2003-01-16 14:27 ` Oliver Kiddle
2003-01-19 23:28   ` Le Wang
2003-01-20 15:55     ` Oliver Kiddle
2003-01-16 14:40 ` Peter Stephenson
2003-01-16 16:22   ` Le Wang
2003-01-16 16:48     ` Le Wang
2003-01-16 16:48     ` Borzenkov Andrey
2003-01-16 17:14     ` Oliver Kiddle
2003-01-16 18:46       ` Le Wang

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