public static @Nullable JBTerminalWidget asJediTermWidget(@NotNull TerminalWidget widget) {
    return widget instanceof TerminalWidgetBridge bridge ? bridge.widget() : null;
  }
public static @Nullable JBTerminalWidget asJediTermWidget(@NotNull TerminalWidget widget)