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

Re: [3.1.9-dev-8] ZLS_COLORS cleared by compinit



Vincent Lefevre wrote:

> When compinit is executed from the .zshrc, the ZLS_COLORS variable
> is cleared. For instance, in my .zshrc:
> 
>   compinit
>   export ZLS_COLORS=$LS_COLORS
>   echo blah2 $ZLS_COLORS
> 
> shows that ZLS_COLORS is set, but when I get the prompt:
> 
> lepois:~> env | grep ZLS                                              <14:00:02
> ZLS_COLORS=
> 
> Moreover, it is cleared each time I do a completion, in fact before
> the completion, so that it is never taken into account. This is
> partly due to the "ZLS_COLORS=..." in _main_complete and _setup.

That's why the doc for complist says:

If the completion system based around shell functions is used, these
parameters should not be set directly because the system controls them
itself.  Instead, the list-colors style should be used (see *Note
Completion System Configuration::).


And following that link:

list-colors
     If the zsh/complist module is used, this style can be used to set
     color specifications as with the ZLS_COLORS and ZLS_COLOURS
     parameters (see *Note The zsh/complist Module::).

     If this style is set for the default tag, the strings in the value
     are taken as specifications that are to be used everywhere.  If it
     is set for other tags, the specifications are used only for
     matches of the type described by the tag.  For this to work best,
     the group-name style must be set to an empty string.  If the
     group-name tag specifies other names for the groups the matches in
     these groups can be colored by using these names together with the
     `(group)...' syntax described for the ZLS_COLORS and ZLS_COLOURS
     parameters and adding the specifications to the value for this
     style with the default tag (although in most cases it should work
     by setting this style for the appropriate tags).

     It is possible to use the same specifications set up for the GNU
     version of the ls command:

          zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}

     The default colors are the same as for the GNU ls command and can
     be obtained by setting the style to an empty string (i.e. '').


Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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