readline windows terminal support (#950)

- update the readline package to have basic support on windows, this is not full feature parity with the unix cli yet
This commit is contained in:
Bruce MacDonald
2023-10-30 16:18:12 -04:00
committed by GitHub
parent 874bb31986
commit 0818b5e318
3 changed files with 68 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ package readline
import (
"fmt"
"os"
"github.com/emirpasic/gods/lists/arraylist"
"golang.org/x/term"
@@ -17,7 +18,8 @@ type Buffer struct {
}
func NewBuffer(prompt *Prompt) (*Buffer, error) {
width, height, err := term.GetSize(0)
fd := int(os.Stdout.Fd())
width, height, err := term.GetSize(fd)
if err != nil {
fmt.Println("Error getting size:", err)
return nil, err