Home Download Buy Blog Forum Support

API method to show the console

API method to show the console

Postby Gunny on Mon Jan 30, 2012 7:12 am

Hi All,

New to sublime, just bought it the other day, and am loving it. Nice work Jon! Especially love I can put it on all three OS's that I have at home... heh.

I've been building a few simple plugins for my own use, and one thing I can't seem to find in the api reference is the ability to show|hide the console from the plugin. Would this be a goofy idea? I've tried using the show_quick_panel, and it's pretty cool, but more complex than what I need at the moment. It would be nice to be able to pop up the console if my plugin has something to show me...

Cheers from Brissie.
Gunny
 
Posts: 2
Joined: Mon Jan 30, 2012 7:08 am

Re: API method to show the console

Postby facelessuser on Mon Jan 30, 2012 4:45 pm

If you turn on Sublime's logging of commands

Code: Select all
sublime.log_commands(True)


And then show and hide the console, you will see the show console command appear in the logging on the console. It shows this:

Code: Select all
show_panel {"panel": "console", "toggle": true}


So, I would assume it to be a window command; so this should work:
Code: Select all
sublime.active_window().run_command("show_panel", {"panel": "console", "toggle": True})
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: API method to show the console

Postby Gunny on Mon Jan 30, 2012 11:52 pm

Awesome, that was perfect. Thanks facelessuser.
Gunny
 
Posts: 2
Joined: Mon Jan 30, 2012 7:08 am


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 5 guests