Notebook: Keep cursor at last position after executing a cell with Ctrl + Return

Created on 30 Jan 2017  路  6Comments  路  Source: jupyter/notebook

The shortcut Ctrl + Return is very convenient but it's a bit annoying that the cursor is not where it was before execution. One always has to click into the cell in order to continue typing. It's very often the case that I just want to check if I e.g. didn't mess up with dimensions or something similar thus I run the cell. However, this requires me now to grab the mouse to reset the cursor.

Wouldn't it be possible to simply restore the cursor position after such a run command so one can continue typing as if nothing happened?

Most helpful comment

You don't need to go for the mouse - if you press Return again after executing the cell, you should go back into edit mode with the cursor at the same place.

All 6 comments

You don't need to go for the mouse - if you press Return again after executing the cell, you should go back into edit mode with the cursor at the same place.

@takluyver Thanks, I didn't know that. I'd prefer it to get there back on its own but at least it works with Return. :)

No problem. I don't think we're going to change how it works, because it was a deliberate decision to switch into command mode there, allowing you to quickly move to other cells if you want to, and also because people are used to that.

Alright, got it. :) At least now I know it's possible :)

workflow

Ha! :-)

Thoughts about putting this in the docs? I just had the exact same question as I've always clicked back into the cell.

For what it's worth I googled "edit the code block jupyter notebook after ctrl-enter" and the doc link above was the first hit. Then I learned it's called a "cell" and googled "cursor back in cell after running jupyter" which puts this issue as the first hit.

Was this page helpful?
0 / 5 - 0 ratings