feat: win unicode flag (#590)

This commit is contained in:
James Read 2025-05-26 08:33:22 +01:00 committed by GitHub
parent 8c073bf45f
commit c20eea29cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

View File

@ -6,6 +6,7 @@ package executor
import (
"context"
"os/exec"
"os"
)
func (e *Executor) Kill(execReq *InternalLogEntry) error {
@ -13,5 +14,11 @@ func (e *Executor) Kill(execReq *InternalLogEntry) error {
}
func wrapCommandInShell(ctx context.Context, finalParsedCommand string) *exec.Cmd {
return exec.CommandContext(ctx, "cmd", "/C", finalParsedCommand)
winCodepage := os.Getenv("OT_WIN_FLAG_U")
if winCodepage == "0" {
return exec.CommandContext(ctx, "cmd", "/C", finalParsedCommand)
} else {
return exec.CommandContext(ctx, "cmd", "/u", "/C", finalParsedCommand)
}
}