-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Screen is cleared after code.py exits #6071
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
Comments
Maybe we should fix this for 7.2.0, since it's a recent regression. |
@dhalbert Is there something special with the funhouse display where the upper left corner is not (0,0)? Whenever I think the best way to debug is to test on the hardware and boot straight to REPL and check the root_group display element (x,y) locations on the screen and then trigger the bug and see the differences. Next step if we want to fix the bug will be to understand if there are board settings that need to be looked up to place the elements in the proper location. If you have hints about that, let me know and I’ll take a look. Unfortunately I don’t have the hardware to test. |
@kmatch98 I tested this on a PyPortal, and though the screen does not blank completely on restart, it does erase the error message. Do you have this or a similar board to test? print("Hello World!")
3/0 # raises ZeroDivisionError |
I think the FunHouse and the PyPortal may differ in the initial rotation. I remember we had to experiment with the display initialization in the FunHouse to get the orientation right. |
@FoamyGuy noticed this in his stream yesterday (2/19) -- he was using a PyPortal.
|
I think maybe the terminal is in the right position but gets the text from it cleared out. If you start using the REPL you do see it begin to show things on the display. Do the start/stop terminal here result in clearing the text that was previously in the terminal away? https://github.com/adafruit/circuitpython/pull/5954/files#diff-edac12d728f2a3db7c325f4b3d9865f5fe9feb69e34302d626dc2cd11b2bd695R172-R173 Looking into this issue a bit, I commented out these two lines and I do then see the zero division error get printed on the display. |
@kmatch98 I did a brief test with split screen REPL / displayio on a build that removes those Do you think there is potential harm in removing these? |
Is it |
Having only one or the other doesn't lead to a better outcome in either case than removing both of them. With only With only |
As for including If we want to keep the old error message around: One thing I noted in the PR (bullet point 4) was whether we wanted to keep the text data in the terminal when we resized it. The challenge with that is that if the terminal is resized, first you have to allocate a new Terminal, then copy the old Terminal data into it, then deallocate the old terminal. Initial discussion in the PR suggested to just start with a clean slate. If we want to keep the data from the previous terminal, I can revisit. |
Now I’m remembering So perhaps Dan’s suggestion is the simplest solution that will cover 99.9% of use cases: Only reset the terminal if it’s the wrong size. |
I thinks okay not to retain the data in the terminal when it gets resized. The user presumably would have intentional resized it so they would understand why it's gone I think. In the case originally reported here though there terminal isn't getting resized, at least not intentionally I don't think. The user has a I do think we want to preserve the terminal text if possible in this case because it makes troubleshooting easier on devices with displays. My guess is maybe the system is calling |
Ok I’ll take a crack at avoiding the start/stop if the size is not changing. |
@kmatch98 If you make a PR, could you make it against |
In looking deeper, if we just run Found it, the tiles get reset in the constructor: |
I said |
Fixed by #6076 |
CircuitPython version
Code/REPL
Behavior
After code.py exits the FunHouse display is empty except the Blinka image in the top left corner. After a soft restart (Ctrl-D) the only text on the display is:
Description
Expected: The text after running should appear on the display.
Actual: The display is cleared when code.py exits.
Any error messages that would be on the display are gone.
Additional information
Same behavior:
Works as expected:
The text was updated successfully, but these errors were encountered: