Closed cmcoffee closed 9 years ago
I can't reproduce this.
What platform? What exact keystrokes reproduce this?
go version go1.4 darwin/ad64 Keystrokes are ctrl-c, Prompt doesn't create the issue, only PasswordPrompt.
func main() {
cli := liner.NewLiner()
cli.SetCtrlCAborts(true)
for {
input, err := cli.PasswordPrompt("Test Password Prompt: ")
fmt.Println(input, err, "\n")
input, err = cli.Prompt("Test Prompt: ")
fmt.Println(input, err, "\n")
if input == "exit" {
cli.Close()
break;
}
}
}
Test Password Prompt: Test Password Prompt: liner: internal error
Test Prompt: ^C prompt aborted
PasswordPrompt, not Prompt. It was in both the title and the body, and I still somehow managed to read it as Prompt each time.
Thanks for the bug report. There will be a fix soon.
Using PasswordPrompt with SetCtrlCAborts(true) doesn't result in liner.ErrPromptAborted as expected, instead results in an "liner: internal error" error.