-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix exit scene behavior (when exit is anticipated) #48
Conversation
Cold you check again if it's working now? And make sure to have a clean state, sometimes during extension development VSCode has some caching issues during reload, so start with a fresh new instance. (at least this was sometimes a problem for me. Occassionally, I had to even kill the
No, I don't think this would be an issue. We are only erroring in case we are trying to spawn a new shell but receive an So, when you receive this error message, the terminal should also open up automatically. What does it show? |
@Splines , you wrote 3 points above.
Other thoughts:
Status:
|
Warning Edit: Nevermind, I think we have to fix #53 first before reviewing this one makes sense. Thanks for testing this out @VladimirFokow! As a few things have changed in the meantime, would you mind checking it out again? And if it doesn't work, could you attach respective log files, where each of them tries to do as minimal things as possible? (e.g. one for each scenario)
Yes, I do agree that this should not appear and it also doesn't for me. If this is still the case in this PR (the error message is shown): could you verify that it is not the case in the
In theory it'd be possible to spawn multiple Manim instances. But the situation I try to avoid is the following:
In theory, supporting the scenario would be possible. But that'd require even more state management, e.g. we'd have to track the terminals and multiple Manim executions across different terminals. I just didn't want to do that, which is why I settled with this limitation (which I don't think is a serious limitation: why would you want to have two Manim previews open at the same time anyways?) (Note the fact that we spawn each new Manim session in a completely new terminal is a different story that is more easily fixable. We could just reuse existing terminals that don't have another command running in them. But that's for another PR...) |
Currently, it doesn't work (click to expand)Log: Manim Notebook.log vid.movfrom manimlib import *
class MyScene(Scene):
def construct(self):
## Test
print('1') But maybe I should review this after main is merged again? |
@VladimirFokow Ready for another review ;) |
I just want to check one more thing, could you please send me the log for the following steps, that'd be awesome.
Your checked-out commit should be 293b93d. |
My behavior on commit 293b93d:
|
The fact that you see this when you press But where this is of course a problem is when this hinders us somehow from disposing the terminal altogether. Could you maybe record a video for me to better understand what is going on at your end, i.e. what you describe in your comment here. |
yes, it's a manim problem that it doesn't handle such an interruption well. |
But it should always be possible to just force-quit any task. I mean we're in a terminal so we can stop anything if we want to. When using Edit: And when starting a new scene while one is already running, we even ask the user to confirm |
Log 1:for this: #48 (comment) vid.mov |
Log 2:for this: #48 (comment) (accidentally clicked twice, but it shouldn't matter) vid.mov |
ok, I didn't notice.. |
Thank you very much! In the background (other VSCode window) there is a trace shown for Sorry nevermind I apparently didn't watch the end of the video... So thanks for the log. Will investigate... |
The issue was again how MacOS handles the keyboard interrupt. It will end the whole IPython session, which is why a On Linux, we still have this reference since a Now to mitigate this, I temporarily store the last active shell before sending the keyboard interrupt. This way, when it comes to disposing the terminal, we still have a valid reference. See 9abc645 |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This fixed the issue: #48 (comment) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Since you've already approved: just write a comment once you approve this PR ;) |
can merge |
Wohoo, nice that it works now for you as well 💫 Lesson learned, exiting is not as easy as expected ;) This would be a lot easier if there was a fix for 3b1b/manim#2236 A future PR can now tackle the case where the user manually disposes a terminal. In this case, we want to detect this event and then reset the state accordingly. |
And thanks a lot for your on-going manual testing support in this one @VladimirFokow ❤ |
I should have done all this myself, |
Don't worry there will be enough future issues waiting for you ;) |
please no😅 |
Haha, that's the goal, but rarely achievable in real life (I speak from experience, even with a nice testing harness, there will always be bugs or unexpected behavior). Otherwise it'd be too boring 😅 |
And just a little remark for the future @bhoov @VladimirFokow : you don't have to review code in PRs that are marked as draft 😇. Just to not waste any time since those PRs are usually a little bit of my playground until I finalize them. Beforehand, lots of things won't work even though the PR itself might look like all the features are implemented. |
In this PR, we fix the following situations:
Kill it
. Before this change, this resulted in a new scene being created and after that being immediately destroyed. The Manim Shell was left in a weird state.Kill it
. Before this change, the progress notification would remain frozen in the last position indefinitely.manimgl
in there. The first session should automatically exit, while the second is booting up.Known limitations