manrajgrover / halo

💫 Beautiful spinners for terminal, IPython and Jupyter
MIT License
2.87k stars 149 forks source link

Bug: Output gets hidden on stop_and_persist in Jupyter notebooks #59

Open manrajgrover opened 6 years ago

manrajgrover commented 6 years ago

Description

Currently, in jupyter notebooks, the final stop_and_persist output is not persisted. I've opened an issue in ipywidget for understanding the issue a little better (https://github.com/jupyter-widgets/ipywidgets/issues/2072).

System settings

Error

The output display is not persited on stop_and_persist call.

Expected behaviour

The output should be persited on stop_and_persist call.

Steps to recreate

widget bug

People to notify

@JungWinter @ManrajGrover

manrajgrover commented 6 years ago

@JungWinter Could you look into this as well?

winterjung commented 6 years ago

Sorry for late response. I checked this issue in python 2.7.13 and find this line is making the problem.

https://github.com/ManrajGrover/halo/blob/4dbaa1a52356281cdf18cc1ce19016ad9276c09e/halo/halo_notebook.py#L38

After removing that line, final output seems to be resolved. Would you like to check this solution? I guess it caused by this change, but not sure.

manrajgrover commented 6 years ago

@JungWinter Yes, it seems to resolve the issue. I'm not sure if it breaks anything else.

mschmo commented 4 years ago

I'd love to check this out for hacktoberfest. @JungWinter thanks for the starting point.

mschmo commented 4 years ago

I looked into this a bit today. This commit caused the bug.

The reason why is ip.events.register('post_run_cell', clean_up) fires after every cell execution, which calls clear() and clears the last output.

I don't want to simply revert that commit, because it seems like there was a good reason for wanting to clean up after execution. Maybe @manrajgrover you can expand on what issue that commit is fixing? I notice it replaced a previous callback to handle SIGINT.