zsh-users
 help / color / mirror / code / Atom feed
* ever-expanding ZLS_COLORS
@ 2000-06-16 15:40 Matthew Lovell
  2000-06-16 16:39 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Lovell @ 2000-06-16 15:40 UTC (permalink / raw)
  To: Zsh Users List

Hi,

I got the following style command from this list a little while ago.
It was given as an example of colored completion.

    zstyle ':completion:*:zsh-options' \
           list-colors '=csh*=31:=*hist*=32:=list*=34:=*glob*=35'

Now, everytime I attempt a completion which uses zsh-options, it seems
ZLS_COLORS just continues to grow:

No completion:
 di=33

After first completion:
 (zsh-options)=csh*=31:=*hist*=32:=list*=34:=*glob*=35:(zsh-options)\
 =csh*=31:=*hist*=32:=list*=34:=*glob*=35:di=33

After second completion:
 (zsh-options)=csh*=31:=*hist*=32:=list*=34:=*glob*=35:(zsh-options)\
 =csh*=31:=*hist*=32:=list*=34:=*glob*=35:(zsh-options)=csh*=31:=*hist*=32:\
 =list*=34:=*glob*=35:di=33
 

Eventually, ZLS_COLORS grows too long for whatever processing is done
(I think awk ends up complaining).  Is there something I can do to
prevent this behavior?

Thanks,
  Matt

-- 
Matthew Lovell
HP Technical Solutions Lab
mailto:lovell@fc.hp.com


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

* Re: ever-expanding ZLS_COLORS
  2000-06-16 15:40 ever-expanding ZLS_COLORS Matthew Lovell
@ 2000-06-16 16:39 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2000-06-16 16:39 UTC (permalink / raw)
  To: Matthew Lovell, Zsh Users List

On Jun 16,  9:40am, Matthew Lovell wrote:
} Subject: ever-expanding ZLS_COLORS
}
} Now, everytime I attempt a completion which uses zsh-options, it seems
} ZLS_COLORS just continues to grow

Yes, I was noticing this myself.  It's happening because some code at the
top of the _setup function tries to merge your list-colors style with the
existing global value of $ZLS_COLORS, but then the old value of $ZLS_COLORS
doesn't get automatically restored when completion is done (the code to do
the restore in _main_complete is conditional upon $compstate[old_list]).

The best workaround for the time being is to assign to ZLS_COLORS in your
precmd function.  If you don't already have a precmd, it'd look like this:

    function precmd() {
	ZLS_COLORS='di=33'
    }

Otherwise just add that assignment to whatever you already have in precmd.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

end of thread, other threads:[~2000-06-16 16:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-16 15:40 ever-expanding ZLS_COLORS Matthew Lovell
2000-06-16 16:39 ` Bart Schaefer

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