Skip to content

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

Merged
dhalbert merged 2 commits into
adafruit:7.2.xfrom
kmatch98:trial_repl
Feb 21, 2022
Merged

Retains REPL contents when display.show(None) is called or code.py finishes and REPL is not resized#6076
dhalbert merged 2 commits into
adafruit:7.2.xfrom
kmatch98:trial_repl

Conversation

@kmatch98

@kmatch98 kmatch98 commented Feb 21, 2022

Copy link
Copy Markdown

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

@dhalbert dhalbert 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.

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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