From c4fbb58f69b0a5cc86c245505311d0a0b3cc1399 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Wed, 9 Jul 2025 15:42:23 -0500 Subject: [PATCH] During session save, use the profile's GUID rather than its Name (#19113) This will prevent Terminal from erroneously selecting a hidden (deleted, disabled or otherwise) profile of the same name during restoration and subsequently using the wrong settings. I am not certain why we used the name at all! Closes #19105 --- src/cascadia/TerminalApp/TerminalPaneContent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cascadia/TerminalApp/TerminalPaneContent.cpp b/src/cascadia/TerminalApp/TerminalPaneContent.cpp index c85009ea0c..42e6e195f0 100644 --- a/src/cascadia/TerminalApp/TerminalPaneContent.cpp +++ b/src/cascadia/TerminalApp/TerminalPaneContent.cpp @@ -95,7 +95,7 @@ namespace winrt::TerminalApp::implementation NewTerminalArgs args{}; const auto& controlSettings = _control.Settings(); - args.Profile(controlSettings.ProfileName()); + args.Profile(::Microsoft::Console::Utils::GuidToString(_profile.Guid())); // If we know the user's working directory use it instead of the profile. if (const auto dir = _control.WorkingDirectory(); !dir.empty()) {