git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* completion troubles with bash
@ 2018-05-01 12:17 Pascal Bourdier
  2018-05-01 12:26 ` Duy Nguyen
  0 siblings, 1 reply; 2+ messages in thread
From: Pascal Bourdier @ 2018-05-01 12:17 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]

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

[-- Attachment #2: git-completion.bash.patch --]
[-- Type: application/octet-stream, Size: 422 bytes --]

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
 }
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: completion troubles with bash
  2018-05-01 12:17 completion troubles with bash Pascal Bourdier
@ 2018-05-01 12:26 ` Duy Nguyen
  0 siblings, 0 replies; 2+ messages in thread
From: Duy Nguyen @ 2018-05-01 12:26 UTC (permalink / raw)
  To: Pascal Bourdier; +Cc: Git Mailing List

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-01 12:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-01 12:17 completion troubles with bash Pascal Bourdier
2018-05-01 12:26 ` Duy Nguyen

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).