void (@NotNull ToolWindow toolWindow) { if (isTerminalToolWindow(toolWindow) && myToolWindow == toolWindow && toolWindow.isVisible() && toolWindow.getContentManager().isEmpty()) { // open a new session if all tabs were closed manually createNewSession(myTerminalRunner, null, true, true); } }