git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: John Bevan <johnlbevan@gmail.com>
To: git@vger.kernel.org
Subject: color.ui is not working as expected
Date: Fri, 24 Oct 2025 14:37:59 +0100	[thread overview]
Message-ID: <CAJLdeLz0p_40vsL=Zu2sHfwD3mdUjbQRpeVZF0WM2gv449pb8Q@mail.gmail.com> (raw)

Hi,

There seems to be an issue with colour formatting on output from git;
e.g. error messages are showing in the console's default colour
instead of red, despite colour.ui being set to always.

I'm using the Windows version of git, but on submitting this issue
there I was directed to yourselves.
https://github.com/git-for-windows/git/issues/5907#issuecomment-3433888979

It seems that the issue is down to errors being sent to the error
function in usage.c
(https://github.com/git/git/blob/master/usage.c#L291), but that
function doesn't include colour based formatting.

Thanks in advance,

JB

(Apologies for not following the advice at:
http://www.chiark.greenend.org.uk/~sgtatham/bugs.html - sadly my
company blocks access to HTTP (without TLS) sites, and this site
doesn't present via HTTPS).

Additional Info

Git for Windows version
git version 2.51.1.windows.1
cpu: x86_64
built from commit: 1454f0a9c4a3a22fb3fd7cc33f76f88cd65ced41
sizeof-long: 4
sizeof-size_t: 8
shell-path: D:/git-sdk-64-build-installers/usr/bin/sh
feature: fsmonitor--daemon
libcurl: 8.16.0
OpenSSL: OpenSSL 3.5.4 30 Sep 2025
zlib: 1.3.1
SHA-1: SHA1_DC
SHA-256: SHA256_BLK
default-ref-format: files
default-hash: sha1

Windows version
Windows 11

Windows CPU architecture
x86_64 (64-bit)

Additional Windows version information
Microsoft Windows [Version 10.0.22631.6060] Options set during
installation Editor Option: VIM Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Merge
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable FSMonitor: Disabled

Other interesting things
ANSI colour codes proven to work by running "e[31mREDe[0m" in pwsh/powershell.

git config --global --list gives:
core.sshcommand='C:\Windows\System32\OpenSSH\ssh.exe'
core.autocrlf=false
core.longpaths=true
core.editor=code -w -n
core.pager=less -FRX
user.name=REDACTED
user.email=REDACTED
user.signingkey=~/.ssh/id_ecdsa.pub
safe.directory=*
gpg.format=ssh
gpg.ssh.allowedsignersfile=~/.ssh/allowed_signers
commit.gpgsign=true
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process filter.lfs.required=true
diff.tool=vscode difftool.vscode.cmd=code -w -n --diff $LOCAL $REMOTE
merge.tool=vscode mergetool.vscode.cmd=code -w -n --merge $REMOTE
$LOCAL $BASE $MERGED init.defaultbranch=main color.ui=auto
color.error=red bold

Git.exe is at: %appdatalocal%\Programs\Git\cmd\git.exe

.gitconfig is at: %UserProfile\.gitconfig

Terminal/shell
PowerShell

Commands that trigger the issue
git checkout nonExistantBranch

Expected behaviour
Output error: pathspec 'nonExistantBranch' did not match any file(s)
known to git in red

Actual behaviour
Output error: pathspec 'nonExistantBranch' did not match any file(s)
known to git in white (terminal default)


                 reply	other threads:[~2025-10-24 13:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJLdeLz0p_40vsL=Zu2sHfwD3mdUjbQRpeVZF0WM2gv449pb8Q@mail.gmail.com' \
    --to=johnlbevan@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).