Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cmd key not working in Jupyter for iPython

I'm running an iPython notebook using the Jupyter notebook interface on my Mac using Chrome. I'd like to be able to delete a cell, or a bunch of cells. The keyboard shortcut is Cmd + D, but when I press that it runs the Chrome "Add Bookmark" shortcut; a similar thing happens on Safari.

How can I fix this? (Not just for Delete, but for the other Cmd + keyboard shortcuts in the Jupyter interface).

like image 204
Bruce Bartlett Avatar asked Apr 19 '16 14:04

Bruce Bartlett


People also ask

How do I enable command mode in Jupyter Notebook?

Enter command mode by pressing Esc or using the mouse to click outside a cell's editor area.

Why the code is not running in Jupyter Notebook?

Jupyter doesn't load or doesn't work in the browserTry disabling any browser extensions and/or any Jupyter extensions you have installed. Some internet security software can interfere with Jupyter. If you have security software, try turning it off temporarily, and look in the settings for a more long-term solution.

What is command mode in Jupyter?

Using Jupyter Notebooks There are two modes: Edit mode and Command mode. Edit mode allows you to type into the cells like a normal text editor. Command mode allows you to edit the notebook as a whole, but not type into individual cells.


2 Answers

The (command) in jupyter doesnt mean the command button in mac or ctrl button in windows. it means "command" mode.

You can enter the command mode either by pressing "Esc" or "ctrl-M"(when a cell is in focus) and then press "D,D" i.e Press D twice, to delete the cell.

like image 129
Rohit Nandi Avatar answered Sep 28 '22 08:09

Rohit Nandi


In addition to what @Rohit answered.

I was having an issue where Cmd + / and Cmd + a weren't working (to comment a line and select all respectively) in Jupyter Notebook for AWS Sagemaker.

My solution was to restart Safari and now it's working properly.

like image 23
Gonzalo Garcia Avatar answered Sep 28 '22 08:09

Gonzalo Garcia