readline
readline copied to clipboard
FuncFilterInputRune fails on filtering ctrl-J
Hi, when I implement the FuncFilterInputRune like below, it fails to filtering it. It places a rune, but blocks all input after.
func filterInput(r rune) (rune, bool) {
switch r {
// block CtrlJ feature
case readline.CharCtrlJ:
return 'a', true
}
return r, true
}
Can be reporoduced on demo: Just replace my implementation and see the result.
https://github.com/chzyer/readline/blob/2972be24d48e78746da79ba8e24e8b488c9880de/example/readline-demo/readline-demo.go#L64
My env is: darwin amd64, iterm2
Thanks in advance