@@ -35,19 +35,14 @@ using namespace winrt::Microsoft::Terminal::Settings::Model;
3535
3636/* static*/ const std::wregex SshHostGenerator::_configKeyValueRegex{ LR"( ^\s*(\w+)\s+([^\s]+.*[^\s])\s*$)" };
3737
38- /* static */ std::wstring_view SshHostGenerator:: _getProfileName (const std::wstring_view& hostName) noexcept
38+ winrt::hstring _getProfileName (const std::wstring_view& hostName) noexcept
3939{
40- return std::wstring_view{ L" " + PROFILE_TITLE_PREFIX + hostName };
40+ return winrt::hstring{ fmt::format ( FMT_COMPILE ( L" {0}{1} " ), PROFILE_TITLE_PREFIX, hostName) };
4141}
4242
43- /* static */ std::wstring_view SshHostGenerator::_getProfileIconPath ( ) noexcept
43+ winrt::hstring _getProfileCommandLine ( const std::wstring_view& sshExePath, const std::wstring_view& hostName ) noexcept
4444{
45- return PROFILE_ICON_PATH;
46- }
47-
48- /* static*/ std::wstring_view SshHostGenerator::_getProfileCommandLine (const std::wstring_view& sshExePath, const std::wstring_view& hostName) noexcept
49- {
50- return std::wstring_view{ L" \" " + sshExePath + L" \" " + hostName };
45+ return winrt::hstring{ fmt::format (FMT_COMPILE (LR"( "{0}" {1})" ), sshExePath, hostName) };
5146}
5247
5348/* static*/ bool SshHostGenerator::_tryFindSshExePath (std::wstring& sshExePath) noexcept
@@ -164,8 +159,8 @@ void SshHostGenerator::GenerateProfiles(std::vector<winrt::com_ptr<implementatio
164159 {
165160 const auto profile{ CreateDynamicProfile (_getProfileName (hostName)) };
166161
167- profile->Commandline (winrt::hstring{ _getProfileCommandLine (sshExePath, hostName) } );
168- profile->Icon (winrt::hstring{ _getProfileIconPath () });
162+ profile->Commandline (_getProfileCommandLine (sshExePath, hostName));
163+ profile->Icon (winrt::hstring{ PROFILE_ICON_PATH });
169164
170165 profiles.emplace_back (profile);
171166 }
0 commit comments