vscode-jupyter icon indicating copy to clipboard operation
vscode-jupyter copied to clipboard

Clear output button disabled even if cell execution counts are not empty

Open 2-5 opened this issue 2 years ago • 1 comments

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:

  1. Create notebook
  2. Enter non outputing code in a new cell, like a = 10
  3. Execute the cell
  4. Notice that the cell now has an execution count
  5. Notice that the Clear Output of All Cells button is disabled

2-5 avatar Nov 14 '22 16:11 2-5

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.

gsverhoeven avatar Jan 19 '24 21:01 gsverhoeven