mirror of https://github.com/Hilbis/Hilbish
fix: dont use readline at all
parent
7193c20e99
commit
e32639800e
4
main.go
4
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
|
||||
|
|
7
shell.go
7
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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue