@Contract("null,_ -> null; !null,_ -> !null")
  public static @NlsSafe String getLocationRelativeToUserHome(@Nullable String path, boolean unixOnly) {
    if (path == null) return null;

    if (SystemInfoRt.isUnix || !unixOnly) {
      File projectDir = new File(path);
      File userHomeDir = new File(SystemProperties.getUserHome());
      if (isAncestor(userHomeDir, projectDir, true)) {
        return '~' + File.separator + getRelativePath(userHomeDir, projectDir);
      }
    }

    return path;
  }
@Contract("null,_ -> null; !null,_ -> !null")
  public static @NlsSafe String getLocationRelativeToUserHome(@Nullable String path, boolean unixOnly)