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

Re: Bug + patch: `zstyle ':completion:*' menu select=long-list` fails to start menu selection



On 3/12/21, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> Peter Stephenson wrote on Fri, 12 Mar 2021 13:36 +00:00:
>>
>> > On 12 March 2021 at 13:11 Marlon Richert <marlon.richert@xxxxxxxxx>
>> > wrote:
>> >
>> >
>> > I found the culprit: I had
>> >
>> > export GREP_OPTIONS='--color=always'
>> >
>> > in my `.zshrc` file and that mangled the .mdd file names.
>>
>> It's probably worth having the following.  It doesn't cover all the
>> possible cases where you can get into trouble, but it's a useful
>> blanket for the standard case where everything is done immediately
>> from configure.
>>
>
> I'm not sure I agree.
>
> - This seems to be a cases of "hard cases make bad law".  Setting
>   --color=always in the environment will break any script that expects
>   grep(1)'s standard semantics, not just configure.  The patch just
>   papers over the problem.
>
> - We shouldn't second-guess the user.  If the user has GREP_OPTIONS set
>   in the environment, that might actually be needed in order to have
>   grep(1) behave correctly.  What if some system uses GREP_OPTIONS to
>   make its grep(1) tool behave POSIX compatibly?
>
> - If this fix is needed, we should send it to autoconf upstream to be
>   incorporated into AC_PROG_GREP.
>
> Instead, I propose:
>
> - Audit configure.ac and make sure we use $GREP rather than grep.
>   Perhaps push this into the makefiles and build scripts too.
>
> - Consider issueing a notice if GREP_OPTIONS is set, or proposing to
>   upstream to have AC_PROG_GREP do so.
>
> - Sending a documentation patch to grep(1)'s man page to point out that
>   using --color=always globally or on the left hand side of a pipe is
>   inadvisable.

For what it's worth, my grep (GNU grep 3.1) says this when I use GREP_OPTIONS:
% GREP_OPTIONS=hi grep
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script

-- 
Mikael Magnusson




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