Unverified Commit 8e0ef931 authored by Michael Yang's avatar Michael Yang Committed by GitHub
Browse files

Merge pull request #2990 from ollama/mxyng/default-term-size

fix: default terminal width, height
parents 280da445 b1e74d4f
......@@ -19,10 +19,9 @@ type Buffer struct {
func NewBuffer(prompt *Prompt) (*Buffer, error) {
fd := int(os.Stdout.Fd())
width, height, err := term.GetSize(fd)
if err != nil {
fmt.Println("Error getting size:", err)
return nil, err
width, height := 80, 24
if termWidth, termHeight, err := term.GetSize(fd); err == nil {
width, height = termWidth, termHeight
}
lwidth := width - len(prompt.prompt())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment