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

Module zsh/complist and coloring



Hi folks!

What has bugged me quite a while now is the following: completions
that add file names but don't use _path_files to add them (but simply
compadd) don't get coloring of the matches. I traced this down to the
-f option of compadd that marks the matches as being filenames.

This doesn't seem to help much, though. For example in _remote_files,
if I add the -f argument to the compadd call, *some* files and
directories are colored -- those that exist on the remote *and* the
local system. So compadd seems to look up the file type of each match.

Strangely enough, patterns like *.jpeg=1;32 in LS_COLORS (whose value
is also used for the list-colors style, which also correctly sets
ZLS_COLORS during completion) should work nevertheless, shouldn't
they? My guess is, that, if compadd doesn't find the file, these
patterns aren't tried at all.

Of course this behaviour is intended, so that non-files (i.e., long
option names or simpe values) are not misleadingly colored. But
especially for _remote_files, from the trailing slash you can tell
directories from files apart. Since you cannot download non-files,
it'd make sense to have a possibility to tell compadd or the complist
module that the matches are all valid filenames, no need for checking
that.

What do you think?

Julius



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