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

Re: [PATCH] avoid localized output from external commands in a few completion



> 2017/12/26 10:19、Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>のメール:
> 
> Bart Schaefer wrote on Mon, 25 Dec 2017 17:04 -0800:
>> On Mon, Dec 25, 2017 at 3:40 PM, Jun T. <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
>>> In some recent Linux distributions, output from commands
>>> like 'nm --help' is localized and can't be analyzed correctly
>>> by completion scripts. We need to reset LC_MESSAGES.
>> 
> 
> That won't help if LC_ALL is set.  Shouldn't we just set LC_ALL=C, or
> use _comp_locale?

Oops, sorry. We need to reset LC_ALL.
I didn't know _comp_locale; is it documented somewhere?

>> Perhaps this is something that would better be done by _main_complete?

Might be, but I'm not sure.

zsh% tar --<TAB>

gives a list of long options with localized description, because the output
of 'tar --help' is localized and _tar uses '_arguments --' for completing
long options. Although the localized description may not be "perfect", some
user would still want to see it.

How about adding an option (say -l) to _call_program so that _comp_locale
is called before the command?


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