Skip to content

Shift + Enter does not run a cell on native notebook #328

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

Closed
rchiodo opened this issue Oct 28, 2020 · 8 comments
Closed

Shift + Enter does not run a cell on native notebook #328

rchiodo opened this issue Oct 28, 2020 · 8 comments
Assignees

Comments

@rchiodo
Copy link
Contributor

rchiodo commented Oct 28, 2020

It can run a cell in the terminal or do nothing.

Repro steps:

  1. Open notebook
  2. Create a new cell at the top
  3. Add code
  4. Hit shift ENTER

Expected behaviour

Cell executes

Actual behaviour

Nothing or it executes the cell in the terminal (cause python extension gets the shift+enter)

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. XXX

Logs

Output for Jupyter in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Jupyter)

XXX

@nathancarter
Copy link

Extremely strong upvote to this one. The absolute first thing any user tries is broken (from the user's point of view).

Doubly bad because, as far as I can tell, there doesn't even exist an action (!) for "execute cell and put cursor in next cell and/or make a new one" which is the default behavior in Jupyter itself. The user literally has to choose one of these two workflows as a replacement for Shift+Enter:

  • Option 1:
    1. Ctrl+Enter to execute cell
    2. Esc to switch out of cell edit mode
    3. B to add a cell below
  • Option 2:
    1. Ctrl+Enter to execute cell
    2. Grab the mouse and click the ... button on the rightmost edge of the cell.
    3. Navigate to "Insert Cell" submenu, then "Insert code cell below" item.

Keep in mind that these workarounds are replacements for literally the most commonly executed keyboard shortcut in all of Jupyter, by a long shot. I realize I'm being a bit blunt, but my mind boggles at a UX decision like this. It's like putting the steering wheel in the glove compartment.

@rchiodo
Copy link
Contributor Author

rchiodo commented Nov 17, 2020

Okay actually it looks like this might be caused by the shift+enter from the python extension stealing shift+enter.

@rchiodo
Copy link
Contributor Author

rchiodo commented Nov 17, 2020

And this is not by design. It wasn't a conscious choice.

@nathancarter
Copy link

Glad to hear it! :) So is the easy workaround to turn off that keyboard shortcut in the Python extension?

@rchiodo
Copy link
Contributor Author

rchiodo commented Nov 17, 2020

Yes if you disable the shift+enter on the python extension, the keystroke is not stolen.

@nathancarter
Copy link

Excellent, I just confirmed that works. Thanks for the super-fast reply!

@nathancarter
Copy link

Of course, I'm sure you're still interested in making sure that Shift+Enter works without this workaround, because in an educational context (where I work) you want first-time users (students) to just drop in and it works. But this is great in the interim.

@greazer
Copy link
Member

greazer commented Nov 19, 2020

We need to detect if shift-enter is being invoked in the context of a native notebook.

@greazer greazer added this to the December 2020 Release milestone Nov 20, 2020
@IanMatthewHuff IanMatthewHuff self-assigned this Nov 23, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants