AlecAivazis / survey

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

fix issue with double output on windows #458

Closed miniscruff closed 1 year ago

miniscruff commented 1 year ago

I was able to fix the double output issues on windows by removing this line, did a manual test on Ubuntu as well. My guess is this is not the best solution so let me know.

Fixes #406 Fixes #368

miniscruff commented 1 year ago

Hi, sorry for the late review and thanks for helping fix this. I think what this PR would need is some kind of regression test that fails without this fix being applied and will fail in the future if this regresses.

I was trying to add one of these but the functional tests do not run on windows (as far as I can tell from these comments: https://github.com/go-survey/survey/blob/b54ce3849e4770c86edea7108c23e8e2c89fea2b/renderer_posix_test.go#L1-L2) to begin with so it is kinda hard. If you have a suggestion for any tests let me know and I will get on it.

mislav commented 1 year ago

I was trying to add one of these but the functional tests do not run on windows

Ah, you are right. I'll investigate this further with your changes as a starting point. Thank you!

miniscruff commented 1 year ago

I was trying to add one of these but the functional tests do not run on windows

Ah, you are right. I'll investigate this further with your changes as a starting point. Thank you!

No problem, let me know if I can be of any help.

mislav commented 1 year ago

@miniscruff Could you please try https://github.com/go-survey/survey/pull/474?

miniscruff commented 1 year ago

@miniscruff Could you please try #474?

That seems to have fixed the problem for me in windows terminal yes.

miniscruff commented 1 year ago

@mislav your PR will take care of the issue so we can probably close this PR correct?

mislav commented 1 year ago

Yes. Thanks for the reminder!