throw platformnotsupportedexception for openconsole
MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
@@ -425,12 +425,9 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
}
// Only Windows waits for the process to exit.
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusBarStatus.ConnectingToHardwareWallet);
await EnumerateHardwareWalletsAsync();
}
- }
finally
{
IsHardwareBusy = false;

MODIFY
WalletWasabi/Hwi/ProcessBridge/HwiProcessBridge.cs
WalletWasabi/Hwi/ProcessBridge/HwiProcessBridge.cs
@@ -27,21 +27,21 @@ namespace WalletWasabi.Hwi.ProcessBridge
var createNoWindow = !openConsole;
var windowStyle = openConsole ? ProcessWindowStyle.Normal : ProcessWindowStyle.Hidden;
- bool unixWithConsole = openConsole && !RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
- if (unixWithConsole)
- {
- var escapedArguments = (hwiPath + " " + arguments).Replace("\"", "\\\"");
- useShellExecute = false;
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
- {
- fileName = "xterm";
- finalArguments = $"-e \"{escapedArguments}\"";
- }
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
- {
- fileName = "osascript";
- finalArguments = $"-e 'tell application \"Terminal\" to do script \"{escapedArguments}\"'";
- }
+ if (openConsole && !RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ throw new PlatformNotSupportedException(RuntimeInformation.OSDescription);
+ //var escapedArguments = (hwiPath + " " + arguments).Replace("\"", "\\\"");
+ //useShellExecute = false;
+ //if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ //{
+ // fileName = "xterm";
+ // finalArguments = $"-e \"{escapedArguments}\"";
+ //}
+ //else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+ //{
+ // fileName = "osascript";
+ // finalArguments = $"-e 'tell application \"Terminal\" to do script \"{escapedArguments}\"'";
+ //}
}
ProcessStartInfo startInfo = new ProcessStartInfo
@@ -59,14 +59,6 @@ namespace WalletWasabi.Hwi.ProcessBridge
using (var process = Process.Start(
startInfo
))
- {
- var successString = "{\"success\":\"true\"}";
- if (unixWithConsole)
- {
- exitCode = 0;
- responseString = successString;
- }
- else
{
await process.WaitForExitAsync(cancel).ConfigureAwait(false);
@@ -78,12 +70,11 @@ namespace WalletWasabi.Hwi.ProcessBridge
else
{
responseString = exitCode == 0
- ? successString
+ ? "{\"success\":\"true\"}"
: $"{{\"success\":\"false\",\"error\":\"Process terminated with exit code: {exitCode}.\"}}";
}
}
}
- }
catch
{
Logger.LogInfo($"{nameof(startInfo.FileName)}: {startInfo.FileName}");

throw platformnotsupportedexception for openconsole