Try fix HWI execute on Linux and OSX
MODIFY
WalletWasabi/Hwi/ProcessBridge/HwiProcessBridge.cs
WalletWasabi/Hwi/ProcessBridge/HwiProcessBridge.cs
@@ -8,6 +8,7 @@ using System.Threading;
using System.Threading.Tasks;
using WalletWasabi.Helpers;
using WalletWasabi.Interfaces;
+using WalletWasabi.Logging;
namespace WalletWasabi.Hwi.ProcessBridge
{
@@ -19,21 +20,43 @@ namespace WalletWasabi.Hwi.ProcessBridge
int exitCode;
string hwiPath = GetHwiPath();
+ var fileName = hwiPath;
+ var finalArguments = arguments;
var redirectStandardOutput = !openConsole;
var useShellExecute = openConsole;
var createNoWindow = !openConsole;
var windowStyle = openConsole ? ProcessWindowStyle.Normal : ProcessWindowStyle.Hidden;
- using (var process = Process.Start(
- new ProcessStartInfo
+ if (openConsole)
+ {
+ var escapedArguments = (hwiPath + " " + arguments).Replace("\"", "\\\"");
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ {
+ fileName = "xterm";
+ finalArguments = $"-c \"{escapedArguments}\"";
+ }
+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+ {
+ fileName = "open";
+ finalArguments = $"-a Terminal \"'{escapedArguments}'\"";
+ useShellExecute = false;
+ }
+ }
+
+ ProcessStartInfo startInfo = new ProcessStartInfo
{
- FileName = hwiPath,
- Arguments = arguments,
+ FileName = fileName,
+ Arguments = finalArguments,
RedirectStandardOutput = redirectStandardOutput,
UseShellExecute = useShellExecute,
CreateNoWindow = createNoWindow,
WindowStyle = windowStyle
- }
+ };
+
+ try
+ {
+ using (var process = Process.Start(
+ startInfo
))
{
await process.WaitForExitAsync(cancel).ConfigureAwait(false);
@@ -50,6 +73,18 @@ namespace WalletWasabi.Hwi.ProcessBridge
: $"{{\"success\":\"false\",\"error\":\"Process terminated with exit code: {exitCode}.\"}}";
}
}
+ }
+ catch
+ {
+ Logger.LogInfo($"{nameof(startInfo.FileName)}: {startInfo.FileName}");
+ Logger.LogInfo($"{nameof(startInfo.Arguments)}: {startInfo.Arguments}");
+ Logger.LogInfo($"{nameof(startInfo.RedirectStandardOutput)}: {startInfo.RedirectStandardOutput}");
+ Logger.LogInfo($"{nameof(startInfo.UseShellExecute)}: {startInfo.UseShellExecute}");
+ Logger.LogInfo($"{nameof(startInfo.CreateNoWindow)}: {startInfo.CreateNoWindow}");
+ Logger.LogInfo($"{nameof(startInfo.WindowStyle)}: {startInfo.WindowStyle}");
+
+ throw;
+ }
return (responseString, exitCode);
}

Try fix HWI execute on Linux and OSX