Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console: No command to clean the console #299

Open
titoBouzout opened this issue May 30, 2014 · 16 comments
Open

Console: No command to clean the console #299

titoBouzout opened this issue May 30, 2014 · 16 comments

Comments

@titoBouzout
Copy link
Collaborator

I'm not aware of any command, to clear the ST console. It would be nice to have one.

@math2001
Copy link

+1 is all I can unfortunately do for now...

@sublimehq sublimehq deleted a comment from jdhao May 6, 2018
@Thom1729
Copy link

What is the use case for this? I'm struggling to think of one, myself. The idea might get more traction if it was clear why it was needed.

@titoBouzout
Copy link
Collaborator Author

To be able to debug packages more easily

@keith-hall
Copy link
Collaborator

opening a new window gives you an empty console for free (in that window)

@evandrocoan
Copy link

evandrocoan commented Aug 22, 2019

Related:

  1. window.find_output_panel( "console" ) returns None instead of the Console output view #2929 window.find_output_panel( "console" ) returns None instead of the Console output view

If we could get the console view, we could clean it, change its font size, etc.

@Thom1729
Copy link

If we could get the console view

I'm not sure there is a View for the console at all.

@FichteFoll
Copy link
Collaborator

I'm pretty sure there is. A lot of views get created when a new window is created, including the console output and input views, as well as several input views for find panels. You can debug this by creating View objects with incremental ids and then checking for various properties, such as the contained text or its size.

@Thom1729
Copy link

Intriguing. I found the view for the console input, but I couldn't identify one for the output. Setting the font size for all of the candidates (by ID) did not affect the output. Also, none of them had a nonzero size. Is it possible that the input is a view but the output is not?

@evandrocoan
Copy link

Is it possible that the input is a view but the output is not?

I think the console could be a view, but it is well hidden due to the problems they had: #2929 (comment)

@Ultra-Instinct-05
Copy link
Contributor

With the console_max_history_lines setting added in 4088, here is a small plugin that can clear console history (courtesy of @OdatNurd)

class ClearConsoleCommand(sublime_plugin.WindowCommand):

	def run(self):
		a = sublime.load_settings("Preferences.sublime-settings")
		current = a.get("console_max_history_lines")
		a.set("console_max_history_lines", 1)
		print("")
		a.set("console_max_history_lines", current)

(One can then have an entry in Widget Context.sublime-menu for it).

@deathaxe deathaxe added this to the next dev cycle milestone Jan 10, 2021
@BenjaminSchaaf
Copy link
Member

Fixed in Sublime Text 4.

@TerminalFi
Copy link

This doesn't appear to be fixed unless I am mis-understanding the issue here.

2021-10-20_13-10-18.mp4

@keith-hall
Copy link
Collaborator

you're referring to the linked issue and not this one? it was marked as invalid. see #2929 (comment)

@evandrocoan
Copy link

@BenjaminSchaaf Fixed in Sublime Text 4.

How it was fixed? Is there a command on Sublime Text 4 to clean the console?

@BenjaminSchaaf
Copy link
Member

Sorry, not sure why this was added to the ST4 release milestone.

@BenjaminSchaaf BenjaminSchaaf removed this from the ST4.0 dev cycle milestone Oct 21, 2021
@Ultra-Instinct-05
Copy link
Contributor

@evandrocoan Look at the linked plugin. #299 (comment) It does the same thing as clear the console. Whether this should be built in or not, I'd leave that to the devs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants