chzyer / readline

Readline is a pure go(golang) implementation for GNU-Readline kind library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FuncFilterInputRune fails on filtering ctrl-J

isacikgoz opened this issue · comments

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.

func filterInput(r rune) (rune, bool) {

My env is: darwin amd64, iterm2

Thanks in advance