{"thread":{"id":"64379","subject":"color.ui is not working as expected","startedAt":"2025-10-24T13:38:11Z","lastAt":"2025-10-24T13:38:11Z","messageCount":1,"participants":["John Bevan"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"529603","messageId":"CAJLdeLz0p_40vsL=Zu2sHfwD3mdUjbQRpeVZF0WM2gv449pb8Q@mail.gmail.com","threadId":"64379","inReplyTo":null,"subject":"color.ui is not working as expected","fromName":"John Bevan","fromEmail":"johnlbevan@gmail.com","sentAt":"2025-10-24T13:37:59Z","receivedAt":"2025-10-24T13:38:11Z","isPatch":false,"sender":{"key":"johnlbevan@gmail.com","avatar":null},"body":"Hi,\n\nThere seems to be an issue with colour formatting on output from git;\ne.g. error messages are showing in the console's default colour\ninstead of red, despite colour.ui being set to always.\n\nI'm using the Windows version of git, but on submitting this issue\nthere I was directed to yourselves.\nhttps://github.com/git-for-windows/git/issues/5907#issuecomment-3433888979\n\nIt seems that the issue is down to errors being sent to the error\nfunction in usage.c\n(https://github.com/git/git/blob/master/usage.c#L291), but that\nfunction doesn't include colour based formatting.\n\nThanks in advance,\n\nJB\n\n(Apologies for not following the advice at:\nhttp://www.chiark.greenend.org.uk/~sgtatham/bugs.html - sadly my\ncompany blocks access to HTTP (without TLS) sites, and this site\ndoesn't present via HTTPS).\n\nAdditional Info\n\nGit for Windows version\ngit version 2.51.1.windows.1\ncpu: x86_64\nbuilt from commit: 1454f0a9c4a3a22fb3fd7cc33f76f88cd65ced41\nsizeof-long: 4\nsizeof-size_t: 8\nshell-path: D:/git-sdk-64-build-installers/usr/bin/sh\nfeature: fsmonitor--daemon\nlibcurl: 8.16.0\nOpenSSL: OpenSSL 3.5.4 30 Sep 2025\nzlib: 1.3.1\nSHA-1: SHA1_DC\nSHA-256: SHA256_BLK\ndefault-ref-format: files\ndefault-hash: sha1\n\nWindows version\nWindows 11\n\nWindows CPU architecture\nx86_64 (64-bit)\n\nAdditional Windows version information\nMicrosoft Windows [Version 10.0.22631.6060] Options set during\ninstallation Editor Option: VIM Custom Editor Path:\nDefault Branch Option:\nPath Option: Cmd\nSSH Option: OpenSSH\nTortoise Option: false\nCURL Option: OpenSSL\nCRLF Option: CRLFAlways\nBash Terminal Option: MinTTY\nGit Pull Behavior Option: Merge\nUse Credential Manager: Enabled\nPerformance Tweaks FSCache: Enabled\nEnable Symlinks: Disabled\nEnable FSMonitor: Disabled\n\nOther interesting things\nANSI colour codes proven to work by running \"e[31mREDe[0m\" in pwsh/powershell.\n\ngit config --global --list gives:\ncore.sshcommand='C:\\Windows\\System32\\OpenSSH\\ssh.exe'\ncore.autocrlf=false\ncore.longpaths=true\ncore.editor=code -w -n\ncore.pager=less -FRX\nuser.name=REDACTED\nuser.email=REDACTED\nuser.signingkey=~/.ssh/id_ecdsa.pub\nsafe.directory=*\ngpg.format=ssh\ngpg.ssh.allowedsignersfile=~/.ssh/allowed_signers\ncommit.gpgsign=true\nfilter.lfs.clean=git-lfs clean -- %f\nfilter.lfs.smudge=git-lfs smudge -- %f\nfilter.lfs.process=git-lfs filter-process filter.lfs.required=true\ndiff.tool=vscode difftool.vscode.cmd=code -w -n --diff $LOCAL $REMOTE\nmerge.tool=vscode mergetool.vscode.cmd=code -w -n --merge $REMOTE\n$LOCAL $BASE $MERGED init.defaultbranch=main color.ui=auto\ncolor.error=red bold\n\nGit.exe is at: %appdatalocal%\\Programs\\Git\\cmd\\git.exe\n\n.gitconfig is at: %UserProfile\\.gitconfig\n\nTerminal/shell\nPowerShell\n\nCommands that trigger the issue\ngit checkout nonExistantBranch\n\nExpected behaviour\nOutput error: pathspec 'nonExistantBranch' did not match any file(s)\nknown to git in red\n\nActual behaviour\nOutput error: pathspec 'nonExistantBranch' did not match any file(s)\nknown to git in white (terminal default)\n"}]}