vscode-jupyter
vscode-jupyter copied to clipboard
Clear output button disabled even if cell execution counts are not empty
Environment data
- VS Code version: 1.73.1
- Jupyter Extension version: v2022.9.1202862440
- OS: Windows 10
Expected behaviour
Clear Output of All Cells
button is enabled if a cell has a non-empty execution count.
Actual behaviour
Clear Output of All Cells
button is disabled even if a cell has a non-empty execution count.
Before committing a notebook to Git, I use the Clear Output of All Cells
button to remove all output and execution count metadata. But this button is disabled sometimes as described in this issue. Because of this I need to find a cell which generates output to execute so that the button becomes enabled.
Maybe the button should be enabled all the time. If has other correctness issues, for example it remains enabled even if you delete the only cell which has output in a notebook.
Steps to reproduce:
- Create notebook
- Enter non outputing code in a new cell, like
a = 10
- Execute the cell
- Notice that the cell now has an execution count
- Notice that the
Clear Output of All Cells
button is disabled
Came here and surprised this is not seen as a bug. Users need to be able to reset execution count, to have meaningful source control on a Jupyter notebook. Even if cells do not produce output. Having to write some code that prints output so the button gets activated, so I can reset the execution count feels like a workaround for a bug.