Interaction between fuzzyfinder and subsequent STDIN usage
akerl-unpriv opened this issue · comments
Describe the bug
To reproduce
- Use this go code: https://gist.github.com/akerl-unpriv/d94d02cb21a333776d4ebaf2a24f8849
go run main.go
- When prompted to make a select, make any selection from the fuzzy menu
- When prompted to enter text, type any text
- Hit enter.
- Type some more text.
- Hit enter again.
Expected behavior
You should never be able to make it to step 6/7; when you enter text at the prompt and hit enter, that text should be captured by ReadString. Instead, something seems to be interacting between Fuzzyfinder and STDIN, that causes the first text and newline to be swallowed.
Screenshots
Environment
- OS: MacOS (tested on Catalina and Mojave)
- Terminal: iTerm and native OSX Terminal, bash and zsh
- go-fuzzyfinder version: v0.2.0
It seems like this may be linked to gdamore/tcell#194
Thank you for reporting the issue.
Just you said, it is caused by gdamore/tcell's bug reported at gdamore/tcell#194 because the issue doesn't happen when using nsf/termbox-go.
One way to avoid the issue is to reverting #8 temporarily. We don't add any features depend on gdamore/tcell, so I think we can replace it without any side-effects.
gdamore/tcell implementation has been reverted at v0.2.1.