public static @Nullable String getSelectedTextInTerminal(@Nullable Component component) {
    return component instanceof TerminalPanel panel ? JBTerminalWidget.getSelectedText(panel) : null;
  }
public static @Nullable String getSelectedTextInTerminal(@Nullable Component component)