Skip to content

Commit

Permalink
fix opening browser on macos.
Browse files Browse the repository at this point in the history
  • Loading branch information
09128319047 authored and wieslawsoltes committed Feb 19, 2024
1 parent e0ed06b commit da5c450
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions WalletWasabi/Helpers/IoHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,21 @@ public static async Task OpenBrowserAsync(string url)
}
else
{
using var process = Process.Start(new ProcessStartInfo
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
FileName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? url : "open",
Arguments = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? $"-e {url}" : "",
CreateNoWindow = true,
UseShellExecute = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
});
url = url.Replace(" ", "\\ ");

await EnvironmentHelpers.ShellExecAsync($"open {url}").ConfigureAwait(false);
}
else
{
using var process = Process.Start(new ProcessStartInfo
{
FileName = url,
CreateNoWindow = true,
UseShellExecute = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
});
}
}
}

Expand Down

0 comments on commit da5c450

Please sign in to comment.