Przeglądaj źródła

use stdout fd for terminal size (#1125)

Jeffrey Morgan 1 rok temu
rodzic
commit
4e612a2e92
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      cmd/cmd.go

+ 1 - 1
cmd/cmd.go

@@ -398,7 +398,7 @@ func generate(cmd *cobra.Command, model, prompt string, wordWrap bool, format st
 		generateContext = []int{}
 	}
 
-	termWidth, _, err := term.GetSize(int(0))
+	termWidth, _, err := term.GetSize(int(os.Stdout.Fd()))
 	if err != nil {
 		wordWrap = false
 	}