How to automatically open a 'Tool Window' used as a custom console view when launching a action



I created a custom "ToolWindow" registered in plugin.xml:

<toolWindow id="My Console"

This custom 'ToolWindow' acts as a console view used to display the result (in live) of a non blocking action.

It works perfectly (info, error, warning logs are well displayed), but only if the custom "Window Tool" was opened manually.

Once this view is open, I can manually close it or remove it from slide bar, and programmatically open it again once my action is launched using the following code:

CustomToolWindowFactory.aToolWindow?.let {
if (!it.isActive) {
it.activate(null, false)
} else if (!it.isVisible) {

My issue is that I've not found how to automatically open it:

- the first time Intellij is open after this extension has been created

- when Intellij starts again and this "Window Tool" was closed in previous session

I always needs to open it manually.

Can you please help me on this topic?

Thanks a lot in advance.

Comment actions Permalink

Did you try using ProjectManagerListener?? I haven't tried it before but, you can try using its projectOpened() method.

Comment actions Permalink

Hello Safeuq,

Thanks a lot for this solution, which works for me :-)

Comment actions Permalink

Thanks a lot Yann. I'll have a look to this other solution.


Please sign in to leave a comment.