Skip to content

Can't force color output using color.ui=always #4095

@xim

Description

@xim
  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
git version 2.38.1.windows.1
cpu: x86_64
built from commit: b85c8f604d375d4d773a36842964e8a7ec056aae
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
[Version 10.0.19044.2006]
  • What options did you set as part of the installation? Or did you choose the
    defaults?

None, using PortableGit

  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

I'm trying to wrap the execution of git in some black magic that redirects stdout.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

I'm executing bash -c 'git -c color.ui=always log' using fork/exec, with stdout redirected. The same happens when running from git-bash.exe though, as described below.

git init repo
cd repo
touch new
git -c color.ui=always status | cat
  • What did you expect to occur after running these commands?

Colors. In the specific example, the text new highlighted in red.

  • What actually happened instead?

It's all black and white.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions