diff --git a/FluentTerminal.App/Dialogs/SshInfoDialog.xaml.cs b/FluentTerminal.App/Dialogs/SshInfoDialog.xaml.cs index 30fab49..629fb74 100644 --- a/FluentTerminal.App/Dialogs/SshInfoDialog.xaml.cs +++ b/FluentTerminal.App/Dialogs/SshInfoDialog.xaml.cs @@ -63,8 +63,6 @@ URL={0} { TerminalThemes.Add(theme); } - - } private void SetupFocus() diff --git a/FluentTerminal.App/Services/SshHelperService.cs b/FluentTerminal.App/Services/SshHelperService.cs index 4a1059d..c7b87bb 100644 --- a/FluentTerminal.App/Services/SshHelperService.cs +++ b/FluentTerminal.App/Services/SshHelperService.cs @@ -147,7 +147,7 @@ namespace FluentTerminal.App.Services if (match.Success) { vm.MoshPortFrom = ushort.Parse(match.Groups["from"].Value); - vm.MoshPortFrom = ushort.Parse(match.Groups["to"].Value); + vm.MoshPortTo = ushort.Parse(match.Groups["to"].Value); } continue; @@ -235,6 +235,8 @@ namespace FluentTerminal.App.Services sb.Append(sshConnectionInfoVm.SshPort.ToString("#####")); } + sb.Append("/"); + bool queryStringAdded = false; if (sshConnectionInfoVm.UseMosh) diff --git a/FluentTerminal.Models/ShellProfile.cs b/FluentTerminal.Models/ShellProfile.cs index 24bc1c8..fac7d41 100644 --- a/FluentTerminal.Models/ShellProfile.cs +++ b/FluentTerminal.Models/ShellProfile.cs @@ -78,10 +78,10 @@ namespace FluentTerminal.Models return other.Id.Equals(Id) && other.PreInstalled.Equals(PreInstalled) - && other.Name.Equals(Name) - && other.Arguments.Equals(Arguments) - && other.Location.Equals(Location) - && other.WorkingDirectory.Equals(WorkingDirectory) + && other.Name.NullableEqualTo(Name) + && other.Arguments.NullableEqualTo(Arguments) + && other.Location.NullableEqualTo(Location) + && other.WorkingDirectory.NullableEqualTo(WorkingDirectory) && other.TabThemeId.Equals(TabThemeId) && other.TerminalThemeId.Equals(TerminalThemeId) && other.LineEndingTranslation == LineEndingTranslation diff --git a/FluentTerminal.Models/SshProfile.cs b/FluentTerminal.Models/SshProfile.cs index dd1a94d..0b7a29d 100644 --- a/FluentTerminal.Models/SshProfile.cs +++ b/FluentTerminal.Models/SshProfile.cs @@ -69,12 +69,11 @@ namespace FluentTerminal.Models return true; } - return string.Equals(otherSsh.Host, Host) + return otherSsh.Host.NullableEqualTo(Host) && otherSsh.SshPort.Equals(SshPort) - && string.Equals(otherSsh.Username, Username) - && (string.IsNullOrEmpty(IdentityFile) - ? string.IsNullOrEmpty(otherSsh.IdentityFile) - : string.Equals(otherSsh.IdentityFile, IdentityFile)) && otherSsh.UseMosh.Equals(UseMosh) + && otherSsh.Username.NullableEqualTo(Username) + && otherSsh.IdentityFile.NullableEqualTo(IdentityFile) + && otherSsh.UseMosh.Equals(UseMosh) && otherSsh.MoshPortFrom.Equals(MoshPortFrom) && otherSsh.MoshPortTo.Equals(MoshPortTo); } diff --git a/FluentTerminal.Models/StringExtensions.cs b/FluentTerminal.Models/StringExtensions.cs new file mode 100644 index 0000000..7bb2402 --- /dev/null +++ b/FluentTerminal.Models/StringExtensions.cs @@ -0,0 +1,12 @@ +namespace FluentTerminal.Models +{ + public static class StringExtensions + { + /// + /// Compares two strings for equality, but assumes that null string is equal to an empty string. + /// + public static bool NullableEqualTo(this string original, string other) => string.IsNullOrEmpty(original) + ? string.IsNullOrEmpty(other) + : original.Equals(other); + } +} \ No newline at end of file