private static void updateWorkingDirectory(@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);
    }
  }
private static void updateWorkingDirectory(@NotNull Content content, @NotNull Data data)