JBTerminalWidget (@NotNull Disposable parent, @Nullable String currentWorkingDirectory, boolean deferSessionStartUntilUiShown) { ShellStartupOptions startupOptions = getStartupOptions(currentWorkingDirectory); TerminalWidget terminalWidget = createShellTerminalWidget(parent, startupOptions); JBTerminalWidget jediTermWidget = JBTerminalWidget.asJediTermWidget(terminalWidget); if (jediTermWidget == null) { Disposer.dispose(terminalWidget); throw new IncompatibleWidgetException(); } scheduleOpenSessionInDirectory(terminalWidget, startupOptions, deferSessionStartUntilUiShown); return jediTermWidget; }