fix: dont use readline at all

pull/38/head
sammy 2021-04-18 15:41:37 -04:00
parent 7193c20e99
commit e32639800e
No known key found for this signature in database
GPG Key ID: 50EE40A2809851F5
2 changed files with 5 additions and 6 deletions

View File

@ -10,7 +10,6 @@ import (
hooks "hilbish/golibs/bait"
"github.com/akamensky/argparse"
"github.com/bobappleyard/readline"
"github.com/Hilbis/Hilbiline"
"github.com/yuin/gopher-lua"
"golang.org/x/term"
@ -132,7 +131,8 @@ func main() {
}
func ContinuePrompt(prev string) (string, error) {
cont, err := readline.String(multilinePrompt)
hl := hilbiline.New(multilinePrompt)
cont, err := hl.Read()
if err != nil {
fmt.Println("")
return "", err

View File

@ -8,7 +8,6 @@ import (
"io"
"strings"
"github.com/bobappleyard/readline"
"github.com/yuin/gopher-lua"
"layeh.com/gopher-luar"
"mvdan.cc/sh/v3/interp"
@ -107,7 +106,7 @@ func splitInput(input string) ([]string, string) {
cmdArgs := []string{}
sb := &strings.Builder{}
cmdstr := &strings.Builder{}
lastcmd := readline.GetHistory(readline.HistorySize() - 1)
lastcmd := "" //readline.GetHistory(readline.HistorySize() - 1)
for _, r := range input {
if r == '"' {
@ -152,8 +151,8 @@ func splitInput(input string) ([]string, string) {
}
func HandleHistory(cmd string) {
readline.AddHistory(cmd)
readline.SaveHistory(homedir + "/.hilbish-history")
//readline.AddHistory(cmd)
//readline.SaveHistory(homedir + "/.hilbish-history")
// TODO: load history again (history shared between sessions like this ye)
}