change liner source so that we can have good tty config

This commit is contained in:
Aidan 2020-07-22 23:00:25 -07:00
parent f69532d54c
commit 91498926d5
No known key found for this signature in database
GPG key ID: 327711E983899316
4 changed files with 14 additions and 3 deletions

View file

@ -21,7 +21,7 @@ import (
"os"
"fmt"
"strconv"
"github.com/peterh/liner"
"github.com/candid82/liner"
"gitlab.com/whom/shs/ast"
"gitlab.com/whom/shs/log"
"gitlab.com/whom/shs/util"
@ -109,6 +109,12 @@ func main() {
line := liner.NewLiner()
defer line.Close()
if !liner.TerminalSupported() {
log.Log(log.ERR,
"Terminal unsupported, continuing in dummy mode!",
"init")
}
line.SetCtrlCAborts(true)
line.SetCompleter(func(line string) (c []string) {
return util.ShellCompleter(line, vars, funcs)