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

@@ -51,11 +51,12 @@ func (i *Instance) Readline() (string, error) {
}
fmt.Print(prompt)
termios, err := SetRawMode(syscall.Stdin)
fd := int(syscall.Stdin)
termios, err := SetRawMode(fd)
if err != nil {
return "", err
}
defer UnsetRawMode(syscall.Stdin, termios)
defer UnsetRawMode(fd, termios)
buf, _ := NewBuffer(i.Prompt)