Bug: ScreenInteractive::FixedSize screen stomps on the history terminal output - #1064
Merged
ArthurSonzogni merged 6 commits intoJun 20, 2025
Conversation
Owner
|
Many thanks! I suspect the CI will output: I suspect this is because we are now drawing the screen twice and those test aren't expecting this. I am going to tweak the patch, refactor a bit FTXUI and add a CHANGELOG. Expect this patch to be merged during the week! |
Contributor
Author
|
@ArthurSonzogni ha, you are so fast, I saw the CI error, and working on an update to fix the reorder warning, but just found the upstream has changed... thanks. |
Owner
|
Thanks @zozowell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug: ScreenInteractive::FixedSize screen stomps on the preceding terminal output
if I use the "ScreenInteractive::FixedSize()" screen and it's
Loopfunction to draw the screen, the entire screen is showed above the latest cursor line, and covers all history terminal output. This bug doesn't exist in other Dimension type likeTerminalOuput.Reproduce
Reproduced on the lates main, using the following sample code:
Root Cause
The problem comes from ScreenInteractive::FixedSize(int dimx, int dimy) factory function, it initialized the parent
Screendimensions to the fixed size at the very beginning, before the first draw.When ScreenInteractive::Draw() did the first render later, it did an redundant ResetPosition, because the screen's dimy is set to the expected fixed size initially, the ResetPostiion would move up the cursor by dimy lines, although actually in the first render, the cursor should not rewind, because no print happened before it.
Fix
Test