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

Changing shortcut of 'run' doesn't work in edit mode #5794

Closed
rightx2 opened this issue Oct 5, 2020 · 4 comments · Fixed by #5847
Closed

Changing shortcut of 'run' doesn't work in edit mode #5794

rightx2 opened this issue Oct 5, 2020 · 4 comments · Fixed by #5847

Comments

@rightx2
Copy link

rightx2 commented Oct 5, 2020

I changed shortcut of run from Cmd-Enter to Ctrl-Enter like below:

Screen Shot 2020-10-05 at 13 29 39

Problem is that it only works in read mode of the cell, not in edit mode. It makes me push esc key every time before run the cell!

@rightx2 rightx2 changed the title Change shortcut of 'run' doesn't work in edit mode Changing shortcut of 'run' doesn't work in edit mode Oct 5, 2020
@cipri-tom
Copy link

I don't understand why this shortcut has changed recently, but it is very annoying that all of a sudden it is Cmd-Enter instead of Ctrl-Enter and that it cannot be easily modified.

@kevin-bates
Copy link
Member

I don't think the side-effect of the recent change was intentional. Unfortunately, I'm not knowledgeable regarding front-end javascript. Looking at the recent change: https://github.com/jupyter/notebook/pull/5120/files
would it work to restore the 'ctrl-enter' entry while leaving the 'cmdtrl-enter' line in place. This would mean that either cmd-enter or ctrl-enter invoke a cell on mac while other platforms expect only ctrl-enter.

Would someone be willing to give this a try? Thanks.

@rightx2
Copy link
Author

rightx2 commented Nov 4, 2020

I want to run the cell with ctrl+enter even in mac os.. but if I changed the key mapping with ctrl+enter it works only in read mode, not in edit mode......

@cipri-tom
Copy link

cipri-tom commented Dec 21, 2020

hi @kevin-bates ,

Thanks for merging the fix ! I've tried it on my side but cannot get it to work :( .

I am now in a new environment, using notebook 6.1.5. Although, as I understand, this fix is not part of this version.
However, I edited keyboardmanager.js in my notebook installation (/miniconda3//lib/python3.8/site-packages/notebook/static/notebook/js/keyboardmanager.js ), but it doesn't seem to be taken into account.

Adding 'ctrl-enter' : 'jupyter-notebook:run-cell', to the mapping does nothing. I;ve also tried lifting the existing cmdtrl-enter mapping, but it still works. I think this file is somehow cached but cannot figure out where. Any ideas ? (I have restarted the server, to no avail).

Thank you !


EDIT: ah, the file is not used directly, but actually used in building main.min.js. I've updated the mapping in main.min.js and it works. Thank you ! Waiting for the next release to be actually widely available

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants