void (@NotNull Content content, @NotNull Data data) { JBTerminalWidget widget = TerminalToolWindowManager.getWidgetByContent(content); TerminalWidget newWidget = widget != null ? widget.asNewWidget() : null; if (widget != null) { data.myWorkingDirectory = getWorkingDirectory(newWidget); } }