CompletableFuture<TermSize> (@NotNull TerminalWidget terminalWidget, @NotNull ShellStartupOptions configuredOptions) { if (terminalWidget instanceof TerminalWidgetImpl terminalWidgetImpl) { return terminalWidgetImpl.initialize(configuredOptions); } return TerminalUiUtils.INSTANCE.awaitComponentLayout(terminalWidget.getComponent(), terminalWidget).thenApply(v -> { return terminalWidget.getTermSize(); }); }