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

Python interactive window delete last cell output shortcut/button

Open MbBrainz opened this issue 3 years ago • 3 comments

When you run a python cell using the interactive window, you encounter the common situation where there is an error. The error messaging of python can be really long and if you're trying to run different approaches of your code, this may lead to multiple super long cell outputs in your interactive window. To clean this up without removing your previous good outputs, it requires quite some scrolling and clicking.

This could be mitigated by either adding a shortcut which deletes the last cell or by adding the option to a output cell to delete the cell above.

a very cheap drawing of what i mean: image

MbBrainz avatar Apr 15 '22 10:04 MbBrainz

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

vscode-triage-bot avatar May 03 '22 18:05 vscode-triage-bot

The Jupyter extension could add this.

greazer avatar May 05 '22 20:05 greazer

you can now select an IW history cell in insiders and use DD or delete to remove the cell, which should improve this workflow

amunger avatar Sep 20 '22 16:09 amunger

Does it remove the code and output together as a unit?

r3m0t avatar Sep 29 '22 13:09 r3m0t

yes, both input and output of the cell are removed (the action can also be undone if focus is in the history view)

amunger avatar Sep 29 '22 21:09 amunger

Was this removed after the most recent release? After updating my VSCode install just now I seem to not be able to delete cells: image

Install versions: image image image image

zatkins2 avatar Dec 08 '22 15:12 zatkins2

@zatkins2 - yes that looks like a regression, made a new issue here https://github.com/microsoft/vscode/issues/168493

You can still click on the cell and press the delete key as a workaround until we get a fix out

amunger avatar Dec 08 '22 18:12 amunger

Thanks. Unfortunately the delete-key trick doesn't work for me (also unfortunately I didn't know that trick in the past, so I can't say if that behavior is also a regression)

zatkins2 avatar Dec 08 '22 19:12 zatkins2

Unfortunately the delete-key trick doesn't work for me

That's strange - can you check your keyboard shortcuts for notebook.cell.delete? There should be an entry from both core and the Extension. Also make sure you don't have focus in the cell input.

image

amunger avatar Dec 08 '22 19:12 amunger

Ah sorry! The focus on the cell input was the issue, it works :)

zatkins2 avatar Dec 08 '22 19:12 zatkins2