fix REPL terminal garbled characters upon code.py finished#6077
Merged
Conversation
FoamyGuy
approved these changes
Feb 21, 2022
FoamyGuy
left a comment
Collaborator
There was a problem hiding this comment.
Looks good to me. Tested successfully on PyPortal. The following scenarios all appear to be working as intended:
code.py without while True and doesn't raise an exception
code.py that does raise an exception (it remains visible)
code.py that contains screen splitting and doesn't have a loop. (screen split works normally and terminal returns to normal full size after code.py completes)
REPL executing code that raises an error. (error is visible but scrolls off the top as expected if you keep running more things)
REPL split screen and returning back to normal with ctrl+D
Thanks for working on this fix @kmatch98!
dhalbert
approved these changes
Feb 21, 2022
dhalbert
left a comment
Collaborator
There was a problem hiding this comment.
Tested and works for me as well. Thanks!
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.
This PR is to resolve the garbled characters observed in:
#6076 (comment)
Test code for standard use of the REPL:
Test code for resizing the REPL. I just see one minor weirdness when using the resized REPL and then code.py finishes running. If there is no serial connection, whenever the code is done running and it resets back to the REPL, the "Code is done running." is not shown. There is just a black screen with Blinka.
If there is a serial connection, it shows the next lines "Autoreload is on....". To avoid this, the last line of your code you can add
display.show(None). Alternately, we could rearrange the sequence of when "Code is done running." is printed so that it occurs after the REPL is reset.