Browse files

Fix PuTTY saved sessions with spaces or special characters not being …

…listed.
  • Loading branch information...
1 parent 1032801 commit 375e737f0299aca577d0d093498ebbf66f2c945e @rmcardle rmcardle committed Mar 20, 2013
Showing with 12 additions and 5 deletions.
  1. +1 −0 CHANGELOG.TXT
  2. +11 −5 mRemoteV1/Config/PuttySessions.vb
View
1 CHANGELOG.TXT
@@ -7,6 +7,7 @@
Fixed issue MR-413 - Can't use aplication
Fixed new connections having a globe icon.
Fixed the category names in the themes tab of the options dialog on Windows XP not showing correctly.
+ Fixed PuTTY saved sessions with spaces or special characters not being listed.
1.71 Beta 2 (2013-03-19):
Added feature MR-336 - Customizable background color for the windows/panels
View
16 mRemoteV1/Config/PuttySessions.vb
@@ -55,22 +55,26 @@ Namespace Config
treeView.EndUpdate()
End Sub
- Protected Shared Function GetSessionNames(Optional ByVal addDefaultSettings As Boolean = False) As String()
+ Protected Shared Function GetSessionNames(Optional ByVal raw As Boolean = False) As String()
Dim sessionsKey As RegistryKey = Registry.CurrentUser.OpenSubKey(PuttySessionsKey)
If sessionsKey Is Nothing Then Return New String() {}
Dim sessionNames As New List(Of String)
- If addDefaultSettings Then sessionNames.Add("Default Settings")
+ If Not raw Then sessionNames.Add("Default Settings") ' Do not localize
For Each sessionName As String In sessionsKey.GetSubKeyNames()
- sessionNames.Add(Web.HttpUtility.UrlDecode(sessionName))
+ If raw Then
+ sessionNames.Add(sessionName)
+ Else
+ sessionNames.Add(Web.HttpUtility.UrlDecode(sessionName))
+ End If
Next
Return sessionNames.ToArray()
End Function
Protected Shared Function LoadSessions() As Connection.PuttySession.Info()
Dim sessionList As New List(Of Connection.PuttySession.Info)
Dim sessionInfo As Connection.Info
- For Each sessionName As String In GetSessionNames()
+ For Each sessionName As String In GetSessionNames(True)
sessionInfo = SessionToConnectionInfo(sessionName)
If sessionInfo Is Nothing Then Continue For
sessionList.Add(sessionInfo)
@@ -85,6 +89,8 @@ Namespace Config
Dim sessionKey As RegistryKey = sessionsKey.OpenSubKey(sessionName)
If sessionKey Is Nothing Then Return Nothing
+ sessionName = Web.HttpUtility.UrlDecode(sessionName)
+
Dim sessionInfo As New Connection.PuttySession.Info
With sessionInfo
.PuttySession = sessionName
@@ -122,7 +128,7 @@ Namespace Config
Public Shared ReadOnly Property Names() As String()
Get
- Return GetSessionNames(True)
+ Return GetSessionNames()
End Get
End Property

0 comments on commit 375e737

Please sign in to comment.