spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.19k stars 1.59k forks source link

Feature: Toolbar button to clear the console #22326

Open jondo opened 1 month ago

jondo commented 1 month ago

Let me suggest to have a "clear console" button in the IPython Console toolbar.

Reason: ctrl+L is not discoverable, and more work to use when the focus is not there already.

This would be similar to the "broom" button of RStudio: RStudio-broom

(Filed against Spyder 5.5.4.)

ccordoba12 commented 1 month ago

Hey @jondo, thanks for reporting. I think this is a good idea, but we already have several extra buttons in the IPython console tabbar:

imagen

So, I don't know an extra button makes sense because it'll reduce even more the space for tabs (RStudio doesn't have this problem because it only supports a single console).

What do you think?

jondo commented 1 month ago

Hi Carlos! Thank you for considering this. In my personal use case, I rarely have more than four consoles open at a time, which would still fit with the additional button. Otherwise I would simply use the console switcher button at the left, or make the console wider. In addition to that, I always have the variable explorer visible, which also has the "Remove all variables" button, so I do not need it in the console window. Also, for me the buttons could be less far apart.

Of course this is just my personal situation, which could be totally different for someone else. Do you know anything about the distribution of used configurations?

PhilipYip1988 commented 1 month ago

I initially thought that the remove all variables button in the ipython console, was to clear the console as it seems natural to have this button there.

It might be better to group the functionality of the remove all variables button on the variable explorer with the remove all variables on the ipython console. i.e. when the dialog box shows

All user-defined variables will be removed. Are you sure you want to proceed?

to have an option to remove variables from all consoles or a select console.

ccordoba12 commented 4 weeks ago

Hi Carlos! Thank you for considering this. In my personal use case, I rarely have more than four consoles open at a time, which would still fit with the additional button. Otherwise I would simply use the console switcher button at the left, or make the console wider. In addition to that, I always have the variable explorer visible, which also has the "Remove all variables" button, so I do not need it in the console window. Also, for me the buttons could be less far apart.

Ok, I think those are good reasons to remove the Remove all variables button and add instead the Clear console one.

I initially thought that the remove all variables button in the ipython console, was to clear the console as it seems natural to have this button there.

Thanks for chiming in @PhilipYip1988. That's a good point too.

when the dialog box shows to have an option to remove variables from all consoles or a select console.

That's a very interesting suggestion, but it's different from this one. So, could you open a new issue about it? Thanks!

ccordoba12 commented 4 weeks ago

Note: I'm leaving this for Spyder 6.1 because it requires a change in our UI, so we can't include it in a bugfix release.