Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to toggle cell output in Jupyter Lab?

In Jupyter Notebook you can toggle the cell output by going into command mode and pressing "O". This command does not work on Jupyter Lab, and I don't see an option to add it. Is there a way to do this, even if it means writing the code for the command?

like image 994
Anton Peraire Avatar asked Oct 28 '25 11:10

Anton Peraire


2 Answers

In Jupyter Notebook you could easily just double click on the cell output to hide it.

This doesn't appear to work in Labs.

Labs has functionality to set keyboard shortcuts.

Settings>Adv Settings> Keyboard Shortcuts You can then add your own shortcut. This example uses "H".

{    "shortcuts": [

//First you can optionally make room for your new hotkey if it is taken. 
// {
// "command": "imageviewer:flip-horizontal",
// "keys": [
// "H"
// ],
// "selector": ".jp-ImageViewer",
// "disabled": true
// },




// Then assign a new hotkey
{
"command": "notebook:hide-cell-outputs",
"keys": [
"H"
],
"selector": ".jp-Notebook:focus",
"disabled": false
}

]
}
like image 130
d0m1n1c Avatar answered Oct 30 '25 02:10

d0m1n1c


Click on the blue vertical bar to the left of the output or code cell to hide/toggle them. Found this when I accidentally clicked on it :)

like image 32
betha manjunath Avatar answered Oct 30 '25 01:10

betha manjunath