use stdout fd for terminal size (#1125)

This commit is contained in:
Jeffrey Morgan
2023-11-14 16:09:09 -05:00
committed by GitHub
parent 6e0f686afa
commit 4e612a2e92

View File

@@ -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
}