Skip to content
This repository was archived by the owner on Apr 19, 2024. It is now read-only.

fix issue with double output on windows#458

Closed
miniscruff wants to merge 1 commit into
AlecAivazis:masterfrom
miniscruff:fix-double-output-on-windows
Closed

fix issue with double output on windows#458
miniscruff wants to merge 1 commit into
AlecAivazis:masterfrom
miniscruff:fix-double-output-on-windows

Conversation

@miniscruff

@miniscruff miniscruff commented Oct 12, 2022

Copy link
Copy Markdown

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 miniscruff marked this pull request as ready for review October 12, 2022 00:21
mislav
mislav previously requested changes Nov 21, 2022

@mislav mislav left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread input.go

lineStr := i.answer

i.AppendRenderedText(lineStr)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code gets called on all platforms and its implementation doesn't differ between platforms. Do you know how it could have caused problems only on Windows but not elsewhere?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not entirely sure what happens on windows to cause this problem, I can try and dig deeper but my only guess right now has to do with the carriage return, as it seems to render the same text twice and this was to remove the second one, which is probably totally wrong. I did do testing on Ubuntu as well and found there was no difference in outputs of my test between before and after my change. Obviously I could be missing some manual test cases so if there are more I can do let me know.

@miniscruff

miniscruff commented Nov 21, 2022

Copy link
Copy Markdown
Author

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

mislav commented Nov 21, 2022

Copy link
Copy Markdown
Collaborator

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!

@mislav mislav dismissed their stale review November 21, 2022 20:06

infeasible

@miniscruff

Copy link
Copy Markdown
Author

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 mislav mentioned this pull request Nov 24, 2022
2 tasks
@mislav

mislav commented Nov 25, 2022

Copy link
Copy Markdown
Collaborator

@miniscruff Could you please try #474?

@miniscruff

Copy link
Copy Markdown
Author

@miniscruff Could you please try #474?

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

@miniscruff

Copy link
Copy Markdown
Author

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

@mislav

mislav commented Dec 13, 2022

Copy link
Copy Markdown
Collaborator

Yes. Thanks for the reminder!

@mislav mislav closed this Dec 13, 2022
@miniscruff miniscruff deleted the fix-double-output-on-windows branch December 13, 2022 17:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Randomly duplicated output for Confirm prompt with a non default answer Duplicated prompt after enter input

2 participants