Unverified Commit 35ec7f07 authored by Daniel Hiltgen's avatar Daniel Hiltgen Committed by GitHub
Browse files

Fix unicode output on windows with redirect to file (#7358)

If we're not writing out to a terminal, avoid setting the console mode
on windows, which corrupts the output file.
parent 5231ae52
...@@ -1318,7 +1318,7 @@ func NewCLI() *cobra.Command { ...@@ -1318,7 +1318,7 @@ func NewCLI() *cobra.Command {
log.SetFlags(log.LstdFlags | log.Lshortfile) log.SetFlags(log.LstdFlags | log.Lshortfile)
cobra.EnableCommandSorting = false cobra.EnableCommandSorting = false
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" && term.IsTerminal(int(os.Stdout.Fd())) {
console.ConsoleFromFile(os.Stdin) //nolint:errcheck console.ConsoleFromFile(os.Stdin) //nolint:errcheck
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment