-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Console doesn't show output until code is done running #936
Comments
Works for me with e8eda3a. What commit are you on? |
AFAIK the issue was that it doesn't scroll, which made it look like it was not updating. |
Oh yeah, I'm remembering the conversation now... |
I am also interested in this issue because. We have situations where the progress of a longer running process is reported via stream messages, but the user needs to scroll manually to see the progress. This is my test case with ipykernel. You need to await the end of the stream to see the lines with the higher numbers. from time import sleep
for i in range(1,200):
print(i)
sleep(0.02) But I want to add some details on this issue. It seems like the scroll down action is triggered when the execute_reply message was received by the client. Please correct me if I am wrong about this, but it was hard to follow the signals. Now consider a kernel sends a lot of stream messages in a row on the iopub channel while executing code and completes with an idle message on the iopub and an execute_reply on the shell channel. It happens that the execute_reply message arrives amongst the stream messages on client side. If you at the websocket frames, it looks like:
From what I've understood, the iopub channel is busy sending all the message but the shell channel is idling, which means the execute_reply message supersedes on the websocket. In ipykernel I've found a suspicious sleep call right before sending the execute_reply message. I assume this is a workaround for that issue. This workaround kind of works for our kernel too, but I think it only obscures a conceptual problem because the channels cannot be synchronized. cf. https://github.com/ipython/ipykernel/blob/83da0a17a00ec9f3dded65b3434980bfb2c84080/ipykernel/kernelbase.py#L92 That was verbose, right? My real question about this issue is, can the output area in the console be scrolled down automatically on insertion of new lines? I guess this would solve the issue. |
Yes, we should scroll the console down when any new lines are added to the output. Honestly I would scroll it down on any model change to the last cell? |
That makes sense to me, I'll implement it tomorrow. |
This should show output as it comes back but only shows the output after everything has run.
The text was updated successfully, but these errors were encountered: