Browse Source

use stdout fd for terminal size (#1125)

Jeffrey Morgan 1 year ago
parent
commit
4e612a2e92
1 changed files with 1 additions and 1 deletions
  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
 	}