Skip to content

Retains REPL contents when display.show(None) is called or code.py finishes and REPL is not resized #6076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2022

Conversation

kmatch98
Copy link

@kmatch98 kmatch98 commented Feb 21, 2022

This PR improves upon a previous PR to make the behavior of the REPL more predictable in 99.9% of uses, yet still provide user access to the REPL group.

This resolves #6071

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Thank you for the quick fix! Tested on FunHouse and PyPortal, with a code.py that throws an exception.

@dhalbert dhalbert merged commit 478fb69 into adafruit:7.2.x Feb 21, 2022
@FoamyGuy
Copy link
Collaborator

I am testing this out on a PyPortal and I think I'm seeing some odd behavior
My code.py contains this:

for i in range(3):
    print("Hello World!")

code.py Runs automatically first time upon power up but all of the "Hello World!"s get scrolled off the top of the display leaving none of them showing:
image
They were visible briefly but scrolled off the top edge.

From here I press ctrl+c to go to the REPL then in the REPL execute something that will raise an error i.e. 78/0

This raises the error and prints the exception message as expected.

Then press ctrl+d to go back to code.py. At this point I see some of the "Hello World!"s but I also still see the divide by zero error which was from the previous REPL instance:
image

I noticed that the "soft reboot is on." message towards the bottom seems to be getting cut off at the end. It ends with an "r" but the next line does not continue on.

From this point I can continue pressing ctrl+c and ctrl+d without running any additional statements in the REPL and I continue to see the divide by zero error each time even though I'm no longer running the code that caused it.

@dhalbert
Copy link
Collaborator

I see that too. I agree, there is something odd going on about which parts of the screen are cleared or where new output goes.

@kmatch98
Copy link
Author

Weird, sorry I missed that. Let me take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants