Cannot add new unmapped key bindings in keyboard shortcut editor

Hi all,

Up front I am running JupyterLab 3.4.4.

I am a long-ish time user of JupyterLab and I am swapping machines. I want to bring my keyboard shortcuts with me from my old install to my new one. Previously (as described here in this towardsdatascience post) I was able to add them to a dictionary of sorts by their name. This made copying them between installs a breeze as well since I could just copy the whole text input from old to new and save.

However, now that the interface is updated I cannot seem to find the shortcuts I am interested in. Since they are not in the list of commands mapped by default, I can’t change the key they are assigned to. It seems that only those commands that are assigned by default appear in the Keyboard Shortcuts editor. To use some examples: Move Cells Down and Move Cells Up.

I was going to put screenshots here but I cannot because I am a new user. I am hoping I can comment them below the topic.

Am I missing where these shortcuts would be? How can I add new ones? I am not afraid to go digging into a file in the install directory as long as someone can point me to it.

Thanks in advance for your help!

Here are the commands as seen in my old install:

And here you can see that they do not show up when searched for in the new install:

Are there any warnings in console when you start up jupyterlab from terminal?

Good question! I think I have stamped them all out. Here is me initializing the server.

No browser warning because this is running headless on a server.

This seems like a bug. Would you mind opening an issue at GitHub - jupyterlab/jupyterlab: JupyterLab computational environment.?

Hey there

I am running into the exact same issue

I was expecting the keyboard shortcuts editor to allow me to ADD a shortcut to a command that, by default, comes without a keyboard binding - like e.g. indeed Move Cells Up or Restart kernel and run all cells
and I can’t find a way to do this in a recent JupyterLab (see versions below)

  • Is there any update on this ?
  • If not, is it at least possible to do this locally without having to install an extension ?

thanks !

$ jupyter --version
Selected Jupyter core packages...
IPython          : 8.14.0
ipykernel        : 6.25.1
ipywidgets       : 8.1.0
jupyter_client   : 8.3.1
jupyter_core     : 5.3.1
jupyter_server   : 2.7.2
jupyterlab       : 4.0.5
nbclient         : 0.7.4
nbconvert        : 7.8.0
nbformat         : 5.9.2
notebook         : 7.0.2
qtconsole        : 5.4.3
traitlets        : 5.9.0

As to my last question, I figured out to use

  • SettingsSettings EditorJSON Settings Editor

that I had at first failed to spot in the upper right corner like so:

image

I’m still interested to know if there are plans to let people do this without messing with JSON :slight_smile:

This was covered on this forum a couple years ago, see here.

Many of the common, major setting adjustments have a form associated that change the JSON for you. The ones you mention are advanced changes.

I don’t know if there is a setting you can assign for moving a cell up. You may wish to check for follow-up discussions here and here and in related links.

I was expecting the keyboard shortcuts editor to allow me to ADD a shortcut to a command that, by default, comes without a keyboard binding - like e.g. indeed Move Cells Up or Restart kernel and run all cells

I’m still interested to know if there are plans to let people do this without messing with JSON :slight_smile:

There is an issue about this tihng here: Semantic commands are missing in shortcut editor (regression) · Issue #13705 · jupyterlab/jupyterlab · GitHub

There is a draft PR:

You are welcome to contribute - we still need to have a way to define a selector in the UI to make it work. Let me now if you need some guidance (but I have very low availability this month).

1 Like