# completion troubles with bash

2 messages from 2018-05-01 to 2018-05-01. Participants: Pascal Bourdier, Duy Nguyen.
Thread: https://gitlist.dev/t/48393

## Pascal Bourdier, 2018-05-01 12:17

Subject: completion troubles with bash
Message-ID: <CAPQz56bts8zFfUHyKJqnefQoH97L5TTA-k3be=5HsdeEbcMqOA@mail.gmail.com>
URL: https://gitlist.dev/e/CAPQz56bts8zFfUHyKJqnefQoH97L5TTA-k3be%3D5HsdeEbcMqOA%40mail.gmail.com

```
Hi,


If "GREP_OPTIONS" is set to '--color=always' , then the git completion
send some escape characters like this :

^[[1;35;40m^[[K                  d^[[m^[[Kiff-files               mergetool
a^[[m^[[Kdd                      d^[[m^[[Kiff-index               mv
a^[[m^[[Kddremove                d^[[m^[[Kiff-tree                name-rev
a^[[m^[[Km                       d^[[m^[[Kifftool                 notes
...


So you could find a small patch to disable color with "grep" in attachment.


Regards,


Pascal Bourdier


diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index b09c8a236..0bc55b9ee 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -837,7 +837,7 @@ __git_commands () {
 	then
 		printf "%s" "${GIT_TESTING_COMMAND_COMPLETION}"
 	else
-		git help -a|egrep '^  [a-zA-Z0-9]'
+		git help -a|egrep --color=never '^  [a-zA-Z0-9]'
 	fi
 }
 

```

## Duy Nguyen, 2018-05-01 12:26

Subject: Re: completion troubles with bash
Message-ID: <CACsJy8AD2bjdRyNDBxcBOEWSknn=kzXfKGtkaYtZmiLshjUg3w@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8AD2bjdRyNDBxcBOEWSknn%3DkzXfKGtkaYtZmiLshjUg3w%40mail.gmail.com
In-Reply-To: <CAPQz56bts8zFfUHyKJqnefQoH97L5TTA-k3be=5HsdeEbcMqOA@mail.gmail.com>

```
On Tue, May 1, 2018 at 2:17 PM, Pascal Bourdier
<pascal.bourdier@gmail.com> wrote:
> Hi,
>
>
> If "GREP_OPTIONS" is set to '--color=always' , then the git completion
> send some escape characters like this :
>
> ^[[1;35;40m^[[K                  d^[[m^[[Kiff-files               mergetool
> a^[[m^[[Kdd                      d^[[m^[[Kiff-index               mv
> a^[[m^[[Kddremove                d^[[m^[[Kiff-tree                name-rev
> a^[[m^[[Km                       d^[[m^[[Kifftool                 notes
> ...
>
>
> So you could find a small patch to disable color with "grep" in attachment.

Yep. The topic 'nd/command-list' on 'pu' accidentally fixes this too
since it removes the use of egrep.

>
>
> Regards,
>
>
> Pascal Bourdier



-- 
Duy

```
