Clear terminal in edit program on resize event#2401
Merged
SquidDev merged 1 commit intocc-tweaked:mc-1.20.xfrom Apr 21, 2026
Merged
Clear terminal in edit program on resize event#2401SquidDev merged 1 commit intocc-tweaked:mc-1.20.xfrom
SquidDev merged 1 commit intocc-tweaked:mc-1.20.xfrom
Conversation
Member
|
Thank you, and sorry for the delay in reviewing! |
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.
Issue:
In edit.lua program, when redrawing contents after

term_resizeevents,redrawMenuandredrawTextfunctions in some cases (if terminal has gotten bigger, and there is less text lines in edited file then height of terminal - 2) do not completely cover all areas of screen, letting it contain old data (usually old menu) from older resolution.This is most visible if user has single line file, and attempts to run it on advanced computer. Resulting by opening and closing new multishell window, 2 resizes, to smaller and then to bigger resolution are most common way players can encounter this bug. Each run call causes new extra copies of old menu to stack in dead space in middle:
Proposed solution:
Simplest solution to this issue is what is proposed in this PR, just adding term.clear() call in
term_resizehandling code before redraws happens ensures all artifacts from before resize would be cleared. While it would be possible to create more complicated handling code, that would only clear deal lines between Text and Menu areas, it would not provide any benefits over this solution, asterm_resizeevents already cause contents to move around.