pythonjupyter-notebook

Keyboard shortcut to clear cell output in Jupyter notebook


Does anyone know what is the keyboard shortcut to clear (not toggle) the cell output in Jupyter Notebook?


Solution

  • For older versions of Jupyter Notebook/Lab

    You can setup your own shortcut in the UI (for the latest master version):

    enter image description here

    This menu can be found in Help > Keyboard Shortcuts in any open notebook.

    For new versions of Jupyter Notebook/Lab

    1. Find and modify existing shortcuts via Settings > Settings Editor > Keyboard Shortcuts

    OR

    1. Add new and custom shortcuts by opening the Advanced Settings Editor by going to Settings > Settings Editor > JSON Settings Editor.

    Note: JSON Settings Editor link is in the upper-right corner of the settings tab.

    OR

    1. Editing the JSON Settings file directly.

    On my Debian Bookworm installation I found the shortcut settings file for Jupyter Lab at the following path: ~/.jupyter/lab/user-settings/@jupyterlab/shortcuts-extension/shortcuts.jupyterlab-settings