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

Re: Bug#289442: zsh: completions do not respect LC_COLLATE



> Thanks for maintaining zsh Clint!
> 
> AFAICT, results returned by tab completions to do not respect
> LC_COLLATE. Preferabley, zsh should sort completions according to
> whatever LC_COLLATE is set to at the time the completions are
> presented.
> 
> To reproduce the bug, go into a directory with upper case and
> lowercase filenames. Set LC_COLLATE to C or POSIX and you should see
> case sensative sorting for a command like ls and in the completions of
> the ls command. Now set LC_COLLATE to, for example, en_US.UTF-8 which
> sorts case insensatively. The behavior will be changed for ls but not
> for tab completions of ls from within zsh.
> 
> Invoking zsh with the LC_COLLATE set does not alter this behavior.

There were some concerns with locale-specific collation order in the
past with respect to surprise data loss when globbing.

http://www.zsh.org/mla/users/1998/msg00740.html

http://www.zsh.org/mla/workers/1999/msg02226.html

However, the real issue with your sorting problem seems to be the use of
a comparison function that ignores locale and behaves differently
depending on the setting of the NUMERIC_GLOB_SORT option.

I think we could change the character comparison at the end of
setbpcmp() to a strcoll(), or do setxfrm()'s at the beginning.



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