void (@NotNull Project project, @NotNull ToolWindow toolWindow) { if (ApplicationManager.getApplication().isUnitTestMode()) { return; } TerminalToolWindowManager terminalToolWindowManager = TerminalToolWindowManager.getInstance(project); terminalToolWindowManager.initToolWindow((ToolWindowEx)toolWindow); TerminalCommandHandlerOptions options = new TerminalCommandHandlerOptions(project); toolWindow.setAdditionalGearActions(new DefaultActionGroup( new SmartCommandExecutionToggleAction(options), new TerminalAdvancedSettingToggleAction("terminal.use.1.0.line.spacing.for.alternative.screen.buffer"), new TerminalAdvancedSettingToggleAction("terminal.fill.character.background.including.line.spacing") )); TerminalArrangementManager terminalArrangementManager = TerminalArrangementManager.getInstance(project); terminalToolWindowManager.restoreTabs(terminalArrangementManager.getArrangementState()); // allow to save tabs after the tabs are restored terminalArrangementManager.setToolWindow(toolWindow); }