@@ -26,6 +26,7 @@ static constexpr std::string_view CursorColorKey{ "cursorColor" };
2626static constexpr std::string_view CursorShapeKey{ " cursorShape" };
2727static constexpr std::string_view CursorHeightKey{ " cursorHeight" };
2828
29+ static constexpr std::string_view ConnectionTypeKey{ " connectionType" };
2930static constexpr std::string_view CommandlineKey{ " commandline" };
3031static constexpr std::string_view FontFaceKey{ " fontFace" };
3132static constexpr std::string_view FontSizeKey{ " fontSize" };
@@ -89,6 +90,7 @@ Profile::Profile(const winrt::guid& guid) :
8990 _cursorShape{ CursorStyle::Bar },
9091 _cursorHeight{ DEFAULT_CURSOR_HEIGHT },
9192
93+ _connectionType{},
9294 _commandline{ L" cmd.exe" },
9395 _startingDirectory{},
9496 _fontFace{ DEFAULT_FONT_FACE },
@@ -280,6 +282,10 @@ Json::Value Profile::ToJson() const
280282 root[JsonKey (CloseOnExitKey)] = _closeOnExit;
281283 root[JsonKey (PaddingKey)] = winrt::to_string (_padding);
282284
285+ if (_connectionType)
286+ {
287+ root[JsonKey (ConnectionTypeKey)] = winrt::to_string (Utils::GuidToString (_connectionType.value ()));
288+ }
283289 if (_scrollbarState)
284290 {
285291 const auto scrollbarState = winrt::to_string (_scrollbarState.value ());
@@ -406,6 +412,10 @@ Profile Profile::FromJson(const Json::Value& json)
406412 }
407413
408414 // Control Settings
415+ if (auto connectionType{ json[JsonKey (ConnectionTypeKey)] })
416+ {
417+ result._connectionType = Utils::GuidFromString (GetWstringFromJson (connectionType));
418+ }
409419 if (auto commandline{ json[JsonKey (CommandlineKey)] })
410420 {
411421 result._commandline = GetWstringFromJson (commandline);
@@ -511,6 +521,16 @@ void Profile::SetDefaultBackground(COLORREF defaultBackground) noexcept
511521 _defaultBackground = defaultBackground;
512522}
513523
524+ void Profile::SetCloseOnExit (bool defaultClose) noexcept
525+ {
526+ _closeOnExit = defaultClose;
527+ }
528+
529+ void Profile::SetConnectionType (GUID connectionType) noexcept
530+ {
531+ _connectionType = connectionType;
532+ }
533+
514534bool Profile::HasIcon () const noexcept
515535{
516536 return _icon.has_value () && !_icon.value ().empty ();
@@ -576,6 +596,18 @@ std::wstring_view Profile::GetTabTitle() const noexcept
576596 std::wstring_view{ L" " , 0 };
577597}
578598
599+ bool Profile::HasConnectionType () const noexcept
600+ {
601+ return _connectionType.has_value ();
602+ }
603+
604+ GUID Profile::GetConnectionType () const noexcept
605+ {
606+ return HasConnectionType () ?
607+ _connectionType.value () :
608+ _GUID{};
609+ }
610+
579611bool Profile::GetCloseOnExit () const noexcept
580612{
581613 return _closeOnExit;
0 commit comments