Explorar o código

Use stdin for term discovery on windows

When you feed input to the cmd via a pipe it no longer reports a warning
Daniel Hiltgen hai 1 ano
pai
achega
c1a81c6fe3
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      cmd/cmd.go

+ 1 - 2
cmd/cmd.go

@@ -900,8 +900,7 @@ func NewCLI() *cobra.Command {
 	cobra.EnableCommandSorting = false
 
 	if runtime.GOOS == "windows" {
-		// Enable colorful ANSI escape code in Windows terminal (disabled by default)
-		console.ConsoleFromFile(os.Stdout) //nolint:errcheck
+		console.ConsoleFromFile(os.Stdin) //nolint:errcheck
 	}
 
 	rootCmd := &cobra.Command{