fix: custom handle ctrl c from readline

windows-fixes
TorchedSammy 2022-02-28 18:32:57 -04:00
parent d355d02b93
commit 36cd4d4123
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 7 additions and 2 deletions

View File

@ -14,6 +14,7 @@ import (
"github.com/pborman/getopt" "github.com/pborman/getopt"
"github.com/yuin/gopher-lua" "github.com/yuin/gopher-lua"
"github.com/maxlandon/readline"
"golang.org/x/term" "golang.org/x/term"
) )
@ -174,8 +175,12 @@ input:
break break
} }
if err != nil { if err != nil {
// If we get a completely random error, print if err != readline.CtrlC {
fmt.Fprintln(os.Stderr, err) // If we get a completely random error, print
fmt.Fprintln(os.Stderr, err)
}
fmt.Println("^C")
continue
} }
oldInput := input oldInput := input