sublimehq / sublime_merge

Issue tracker for Sublime Merge
https://www.sublimemerge.com
276 stars 14 forks source link

There are ANSI escape sequences in the command output #827

Open jfcherng opened 4 years ago

jfcherng commented 4 years ago

Version info

Description

There are ANSI escape sequences in the command output.

image

Steps to reproduce

Steps to reproduce the behavior:

  1. Set the following in gitconfig
    [pull]
    rebase = true
  2. I just click the pull button image
  3. See the command output history

Let me know if more information needed.

Expected behavior

Remove them.

dpjohnst commented 4 years ago

Hi @jfcherng,

Thank you for reporting this issue.

I'm curious if you have any color configuration for. Do you have any of the color config values set? (See: https://git-scm.com/docs/git-config#Documentation/git-config.txt-coloradvice)

This information should be visible under the Sublime Merge debug information (Help > Debug Information) under the git config section.

Thanks, - Dylan

jfcherng commented 4 years ago

Yes, for settings start with color. from the debug info:

color.branch=auto
color.diff=auto
color.diff-highlight.newhighlight=green bold 22
color.diff-highlight.newnormal=green bold
color.diff-highlight.oldhighlight=red bold 52
color.diff-highlight.oldnormal=red bold
color.diff.commit=227 bold
color.diff.frag=magenta bold
color.diff.meta=227
color.diff.new=green bold
color.diff.old=red bold
color.diff.whitespace=red reverse
color.interactive=true
color.status=auto
color.ui=true
dpjohnst commented 4 years ago

Hi @jfcherng,

Thanks for the response. I've noticed you have a few color values set to true rather than auto. I'd suggest changing these to auto, as Git will automatically strip the ANSI escape sequences from the output when outputting to Sublime Merge.

Let me know whether this resolves the issue for you.

Kind regards, - Dylan

jfcherng commented 4 years ago

I have found the culprit. It's weird, but it does it.

To reproduce, simply have a global .gitconfig ONLY having the following content.

[pull]
    rebase = true
dreikanter commented 9 months ago

I encounter this issue almost daily since we use several different linters via the git hooks. Our team needs coloring when running git commands through the console, so disabling colors globally is not an option.

I already considered using NO_COLOR , but some CLI tools do not support it.

I can make a donation if somebody fixes this in the upcoming Sublime Merge release. The fix seems to be trivial.

CleanShot 2024-03-03 at 21 20 45@2x