fix: Force English locale in branch query command. (#1078)

This commit is contained in:
Gadfly 2025-03-10 20:05:37 +08:00 committed by GitHub
parent b4fbc2372b
commit 860f52153b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 4 deletions

View file

@ -19,7 +19,10 @@ namespace SourceGit.Commands
// Force using en_US.UTF-8 locale to avoid GCM crash
if (OperatingSystem.IsLinux())
start.Environment.Add("LANG", "en_US.UTF-8");
{
start.Environment.Add("LANG", "C");
start.Environment.Add("LC_ALL", "C");
}
// Fix macOS `PATH` env
if (OperatingSystem.IsMacOS() && !string.IsNullOrEmpty(Native.OS.CustomPathEnv))
@ -50,7 +53,10 @@ namespace SourceGit.Commands
// Force using en_US.UTF-8 locale to avoid GCM crash
if (OperatingSystem.IsLinux())
start.Environment.Add("LANG", "en_US.UTF-8");
{
start.Environment.Add("LANG", "C");
start.Environment.Add("LC_ALL", "C");
}
// Fix macOS `PATH` env
if (OperatingSystem.IsMacOS() && !string.IsNullOrEmpty(Native.OS.CustomPathEnv))