mirror of https://github.com/Hilbis/Hilbish
fix: custom handle ctrl c from readline
parent
d355d02b93
commit
36cd4d4123
9
main.go
9
main.go
|
@ -14,6 +14,7 @@ import (
|
|||
|
||||
"github.com/pborman/getopt"
|
||||
"github.com/yuin/gopher-lua"
|
||||
"github.com/maxlandon/readline"
|
||||
"golang.org/x/term"
|
||||
)
|
||||
|
||||
|
@ -174,8 +175,12 @@ input:
|
|||
break
|
||||
}
|
||||
if err != nil {
|
||||
// If we get a completely random error, print
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
if err != readline.CtrlC {
|
||||
// If we get a completely random error, print
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
}
|
||||
fmt.Println("^C")
|
||||
continue
|
||||
}
|
||||
oldInput := input
|
||||
|
||||
|
|
Loading…
Reference in New Issue