From e32639800ee301b041da0fc024ecebf09f23c731 Mon Sep 17 00:00:00 2001 From: sammy <38820196+TorchedSammy@users.noreply.github.com> Date: Sun, 18 Apr 2021 15:41:37 -0400 Subject: [PATCH] fix: dont use readline at all --- main.go | 4 ++-- shell.go | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index b3ac37b..cfddf8d 100644 --- a/main.go +++ b/main.go @@ -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 diff --git a/shell.go b/shell.go index 44e2bce..60e07cb 100644 --- a/shell.go +++ b/shell.go @@ -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) }