default terminal width, height
This commit is contained in:
parent
f678f5c5c3
commit
b1e74d4fda
1 changed files with 3 additions and 4 deletions
|
@ -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())
|
||||||
|
|
Loading…
Add table
Reference in a new issue