After I select run all
, run all above
, or run all below
in a Jupyter notebook, how can I jump to the cell currently being run?
Thank you for this idea, Aaron. But it works only once on a full run, so it needs to be improved to be more useful.
I have expanded it into a shortcut that can be used many times during the execution of the notebook.
add this to ~/.jupyter/custom/custom.js
:
// Go to Running cell shortcut
Jupyter.keyboard_manager.command_shortcuts.add_shortcut('Alt-I', {
help : 'Go to Running cell',
help_index : 'zz',
handler : function (event) {
setTimeout(function() {
// Find running cell and click the first one
if ($('.running').length > 0) {
//alert("found running cell");
$('.running')[0].scrollIntoView();
}}, 250);
return false;
}
});
Now you can press Alt-I
any time to have the notebook refocus the view on to the running cell.
Next it'd be nice to write an extension/shortcut that keeps the current running cell's view in focus during all of execution.
Although not particularly elegant, when I need custom functionality like this I make use of jupyter's custom.js.
The following snippet binds to the buttons' click events and selects the currently executing cell. You can place it in ~/.jupyter/custom/custom.js
$('#run_all_cells, #run_all_cells_above, #run_all_cells_below').click(function() {
setTimeout(function() {
// Find running cell and click the first one
if ($('.running').length > 0) {
$('.running')[0].click();
}
}, 250);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With