From b755f527542a516d8061f73c12e0456dc99055d3 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 9 Oct 2025 13:07:33 +0200 Subject: [PATCH] Use C locale instead of en_US.UTF-8 to force English language Some users reported that en_US.UTF-8 is not available on their systems, leading to warnings in the command log. "C" also forces the language to English, and is guaranteed to be available everywhere. --- pkg/commands/git_commands/rebase.go | 8 ++++---- pkg/commands/oscommands/cmd_obj_runner.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/commands/git_commands/rebase.go b/pkg/commands/git_commands/rebase.go index d882d9b1a..6d89276d6 100644 --- a/pkg/commands/git_commands/rebase.go +++ b/pkg/commands/git_commands/rebase.go @@ -244,8 +244,8 @@ func (self *RebaseCommands) PrepareInteractiveRebaseCommand(opts PrepareInteract cmdObj.AddEnvVars( "DEBUG="+debug, - "LANG=en_US.UTF-8", // Force using EN as language - "LC_ALL=en_US.UTF-8", // Force using EN as language + "LANG=C", // Force using English language + "LC_ALL=C", // Force using English language "GIT_SEQUENCE_EDITOR="+gitSequenceEditor, ) @@ -277,8 +277,8 @@ func (self *RebaseCommands) GitRebaseEditTodo(todosFileContent []byte) error { cmdObj.AddEnvVars( "DEBUG="+debug, - "LANG=en_US.UTF-8", // Force using EN as language - "LC_ALL=en_US.UTF-8", // Force using EN as language + "LANG=C", // Force using English language + "LC_ALL=C", // Force using English language "GIT_EDITOR="+ex, "GIT_SEQUENCE_EDITOR="+ex, ) diff --git a/pkg/commands/oscommands/cmd_obj_runner.go b/pkg/commands/oscommands/cmd_obj_runner.go index b19ec89b5..49e608a60 100644 --- a/pkg/commands/oscommands/cmd_obj_runner.go +++ b/pkg/commands/oscommands/cmd_obj_runner.go @@ -330,7 +330,7 @@ func (self *cmdObjRunner) runAndDetectCredentialRequest( promptUserForCredential func(CredentialType) <-chan string, ) error { // setting the output to english so we can parse it for a username/password request - cmdObj.AddEnvVars("LANG=en_US.UTF-8", "LC_ALL=en_US.UTF-8") + cmdObj.AddEnvVars("LANG=C", "LC_ALL=C") return self.runAndStreamAux(cmdObj, func(handler *cmdHandler, cmdWriter io.Writer) { tr := io.TeeReader(handler.stdoutPipe, cmdWriter)