Skip to content

Commit

Permalink
Try terminal first
Browse files Browse the repository at this point in the history
  • Loading branch information
krschau committed Aug 28, 2024
1 parent c526666 commit 027762f
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions extensions/CoreWidgetProvider/Widgets/SSHWalletWidget.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Text.Json;
Expand Down Expand Up @@ -149,12 +150,26 @@ private void HandleConnect(WidgetActionInvokedArgs args)
var cmd = new Process();
cmd.StartInfo = new ProcessStartInfo
{
FileName = "cmd.exe",
Arguments = $"/k \"ssh {args.Data}\"",
FileName = "wt.exe",
Arguments = $"ssh {args.Data}",
UseShellExecute = true,
};

cmd.Start();
try
{
cmd.Start();
}
catch (Win32Exception win32Ex)
{
Log.Error(win32Ex, "Failed to start wt.exe. Falling back to cmd.exe.");
cmd.StartInfo = new ProcessStartInfo
{
FileName = "cmd.exe",
Arguments = $"/k \"ssh {args.Data}\"",
UseShellExecute = true,
};
cmd.Start();
}
}

private void HandleCheckPath(WidgetActionInvokedArgs args)
Expand Down

0 comments on commit 027762f

Please sign in to comment.