mirror of
https://github.com/ollama/ollama.git
synced 2025-09-14 02:51:11 +02:00
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.
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user