Commit b1e74d4f authored by Michael Yang's avatar Michael Yang
Browse files

default terminal width, height

parent f678f5c5
...@@ -19,10 +19,9 @@ type Buffer struct { ...@@ -19,10 +19,9 @@ type Buffer struct {
func NewBuffer(prompt *Prompt) (*Buffer, error) { func NewBuffer(prompt *Prompt) (*Buffer, error) {
fd := int(os.Stdout.Fd()) fd := int(os.Stdout.Fd())
width, height, err := term.GetSize(fd) width, height := 80, 24
if err != nil { if termWidth, termHeight, err := term.GetSize(fd); err == nil {
fmt.Println("Error getting size:", err) width, height = termWidth, termHeight
return nil, err
} }
lwidth := width - len(prompt.prompt()) 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