AlecAivazis / survey

A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
MIT License
4.07k stars 350 forks source link

Randomly duplicated output for Confirm prompt with a non default answer #406

Open suarezjulian opened 2 years ago

suarezjulian commented 2 years ago

What operating system and terminal are you using? Ubuntu 21.10 (this also runs on my CI which is painful)

An example that showcases the bug. When using unit tests I sometimes see this behaviour on Ubuntu, I think it is related to https://github.com/AlecAivazis/survey/pull/404

Full example code https://github.com/suarezjulian/survey_test

What did you expect to see?

?Do you like pizza? Yes

What did you see instead?

?Do you like pizza (y/N)? y
?Do you like pizza? Yes
suarezjulian commented 2 years ago

I'm willing to contribute a PR to fix this, but I will need some guidance

mislav commented 2 years ago

@suarezjulian Does this sound like the same issue as https://github.com/AlecAivazis/survey/issues/368?

In any case, it would be great if you could investigate this and provide a fix. I didn't yet have time to look into this. My suggestion would be to make a smallest reproduction case possible, then convert that case into a unit test in this project, then try to figure out how to get the unit test to pass and isolate the underlying bug.

suarezjulian commented 2 years ago

@mislav yeah that looks related or even the same issue as this one. I will try to create a smaller test case