KeyMap doesn't behave as expected on macOS

I’ve been using jupyter notebook since 2016. I run jupyter in docker containers based on the official images (e.g. JupyterLab 2.2.5 from jupyter/scipy-notebook) and interact with them from macOS. I’ve found that in the latest release, macOS keyboard shortcuts no longer work as expected.

Examples:
Select-All: With a cursor inside a cell, I press Cmd-A. I expect to select all text, instead nothing happens.
Copy: I run a cell that produces some output, I select some text in the output and press Cmd-C. I expect the selcted text to be copied to the clipboard. Instead the clipboard isn’t updated.
Emacs-based shortcuts: macOS allows you to move to start of line with Ctrl-A and end-of-line with Ctrl-E for most text boxes. This used to work great in jupyter, but no longer works in this version of lab.

I’d like to make use of the enhancements of JupyterLab, but I’d like the keyboard to behave the same as it has done in notebooks for the past years.

Ideally I’d like to do this with one toggle rather than manually searching through tens of entries in a JSON.

I just upgraded a binder instance I have to run the current version 2.2.6 and all those work. You can try it by launching in your browser by clicking here. (Cancel the rebuild to skip when that prompt comes up at the start of the session as it doesn’t seem to matter and I didn’t deal with it for this test.) Keep in mind they may not work in your computer in your browser if the problem is there. But they work on my Mac running the current chrome.

The current release I am seeing listed is 2.2.6, see here and here, and so I skipped to that one for testing.

When I searched among the reported issues, I didn’t see anything obvious that matched what you are seeing; however, maybe I simply didn’t stumble upon the lucky search terms.

Which browsers have you tried?

Thanks for helping me search for a solution. I fixed the issue for myself on JupyterLab 2.2.5.

I am on Firefox 80.0.1. I tested in a private browser window and didn’t have this issue; I also had issues on other websites (like whatsapp, facebook messenger) where they only worked in a private window. Turns out a Firefox extension I use called “User-Agent Switcher” was breaking keyboard shortcuts in JupyterLab and breaking other websites.

I’m not sure why JupyterLab cares about my user agent for keyboard shortcuts, but it looks like this extension breaks multiple sites so I’m fine with disabling it.

1 Like

I don’t know the full reason. I think here, here, and here might start to give you a sense of why Jupyter or Codemirror would care. JupyterLab being way more fancy probably cares more, and so maybe that is why you didn’t encounter it in the classic notebook interface in the past. (That assumes you didn’t add that extension recently.)