Skip to content
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

matplotlib %notebook steals focus in jupyter notebooks #4758

Closed
ericdill opened this issue Jul 22, 2015 · 1 comment
Closed

matplotlib %notebook steals focus in jupyter notebooks #4758

ericdill opened this issue Jul 22, 2015 · 1 comment

Comments

@ericdill
Copy link
Contributor

On matplotlib master, executing a cell that displays a plot steals focus from the jupyter notebook with the %matplotlib notebook magic enabled. By 'steals focus' I mean that the only key combination that will interact with the notebook is shift+enter, which @tacaswell tells me is because matplotlib special cases that one. I'm conflicted by this behavior, as, I can see compelling arguments for both stealing keyboard focus and NOT stealing keyboard focus. I personally like using the notebook keyboard shortcuts (up arrow to move up, down arrow to move down, 00 to restart the kernel, etc...), so this is very disruptive behaviour to my work flow. I would be happy with a new keyboard shortcut in the matplotlib notebook front-end that returns focus to the notebook.

@tacaswell tacaswell added this to the proposed next point release milestone Jul 22, 2015
@ericdill
Copy link
Contributor Author

@tacaswell so shift+enter actually does exactly what I suggested above. I thought that, once the mpl widget stole the focus that shift+enter was executing the next cell. In actuality, it is returning focus to the notebook and moving to the next cell, but not executing it. My apologies for the noise.

physinet added a commit to physinet/matplotlib that referenced this issue Oct 31, 2018
Commit 86ac6ce undid the changes from commit d527799 to change the behavior of shift-enter in Jupyter notebook, as discussed in matplotlib#1124, matplotlib#4758, and matplotlib#6752.

With the changes here, shift-enter now selects the next cell, executes it, and then selects the following cell.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants