Open BoPeng opened 7 years ago
There is an extension .. https://www.quora.com/Is-there-a-way-to-configure-Jupyter-notebook-to-auto-scroll-output-cells
The key code seems to be something like
$(".output").on("resize", function () {
if (!params.scrollDownIsEnabled) return;
var output = $(this);
setTimeout(function () {
output.scrollTop(output.prop("scrollHeight"));
console.log("height: " + output.prop("scrollHeight"));
}, 0);
});
The code was for Jupyter 4.x and I have adapted it for Jupyter 5.x.
Somehow does not work now.
Not sure why but scrolling sometimes work and sometimes not.
import time
for i in range(50):
sh('ls')
sh(f'echo {i}')
time.sleep(0.3)
Not at all sure if it can be done but one problem with the notebook interface is that the outputs are appended to the output cell and you have to constantly scroll to check the last few lines. Perhaps we can do something like auto-scroll, or show only the last 50 lines of results to give users a familiar "terminal" feeling.