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"
|
hooks "hilbish/golibs/bait"
|
||||||
|
|
||||||
"github.com/akamensky/argparse"
|
"github.com/akamensky/argparse"
|
||||||
"github.com/bobappleyard/readline"
|
|
||||||
"github.com/Hilbis/Hilbiline"
|
"github.com/Hilbis/Hilbiline"
|
||||||
"github.com/yuin/gopher-lua"
|
"github.com/yuin/gopher-lua"
|
||||||
"golang.org/x/term"
|
"golang.org/x/term"
|
||||||
|
@ -132,7 +131,8 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func ContinuePrompt(prev string) (string, error) {
|
func ContinuePrompt(prev string) (string, error) {
|
||||||
cont, err := readline.String(multilinePrompt)
|
hl := hilbiline.New(multilinePrompt)
|
||||||
|
cont, err := hl.Read()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("")
|
fmt.Println("")
|
||||||
return "", err
|
return "", err
|
||||||
|
|
7
shell.go
7
shell.go
|
@ -8,7 +8,6 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/bobappleyard/readline"
|
|
||||||
"github.com/yuin/gopher-lua"
|
"github.com/yuin/gopher-lua"
|
||||||
"layeh.com/gopher-luar"
|
"layeh.com/gopher-luar"
|
||||||
"mvdan.cc/sh/v3/interp"
|
"mvdan.cc/sh/v3/interp"
|
||||||
|
@ -107,7 +106,7 @@ func splitInput(input string) ([]string, string) {
|
||||||
cmdArgs := []string{}
|
cmdArgs := []string{}
|
||||||
sb := &strings.Builder{}
|
sb := &strings.Builder{}
|
||||||
cmdstr := &strings.Builder{}
|
cmdstr := &strings.Builder{}
|
||||||
lastcmd := readline.GetHistory(readline.HistorySize() - 1)
|
lastcmd := "" //readline.GetHistory(readline.HistorySize() - 1)
|
||||||
|
|
||||||
for _, r := range input {
|
for _, r := range input {
|
||||||
if r == '"' {
|
if r == '"' {
|
||||||
|
@ -152,8 +151,8 @@ func splitInput(input string) ([]string, string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func HandleHistory(cmd string) {
|
func HandleHistory(cmd string) {
|
||||||
readline.AddHistory(cmd)
|
//readline.AddHistory(cmd)
|
||||||
readline.SaveHistory(homedir + "/.hilbish-history")
|
//readline.SaveHistory(homedir + "/.hilbish-history")
|
||||||
// TODO: load history again (history shared between sessions like this ye)
|
// TODO: load history again (history shared between sessions like this ye)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue