|
18 | 18 | #include "SshHostGenerator.h"
|
19 | 19 | #endif
|
20 | 20 |
|
21 |
| -// userDefault.h is like the above, but with a default template for the user's settings.json. |
22 |
| -#include <LegacyProfileGeneratorNamespaces.h> |
23 |
| - |
24 | 21 | #include "ApplicationState.h"
|
25 | 22 | #include "DefaultTerminal.h"
|
26 | 23 | #include "FileUtils.h"
|
@@ -460,35 +457,51 @@ bool SettingsLoader::FixupUserSettings()
|
460 | 457 | CommandlinePatch{ DEFAULT_WINDOWS_POWERSHELL_GUID, L"powershell.exe", L"%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" },
|
461 | 458 | };
|
462 | 459 |
|
| 460 | + static constexpr std::array iconsToClearFromVisualStudioProfiles{ |
| 461 | + std::wstring_view{ L"ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png" }, |
| 462 | + std::wstring_view{ L"ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png" }, |
| 463 | + }; |
| 464 | + |
463 | 465 | auto fixedUp = userSettings.fixupsAppliedDuringLoad;
|
464 | 466 |
|
465 | 467 | fixedUp = RemapColorSchemeForProfile(userSettings.baseLayerProfile) || fixedUp;
|
466 | 468 | for (const auto& profile : userSettings.profiles)
|
467 | 469 | {
|
468 | 470 | fixedUp = RemapColorSchemeForProfile(profile) || fixedUp;
|
469 | 471 |
|
470 |
| - if (!profile->HasCommandline()) |
| 472 | + if (profile->HasCommandline()) |
471 | 473 | {
|
472 |
| - continue; |
| 474 | + for (const auto& patch : commandlinePatches) |
| 475 | + { |
| 476 | + if (profile->Guid() == patch.guid && til::equals_insensitive_ascii(profile->Commandline(), patch.before)) |
| 477 | + { |
| 478 | + profile->ClearCommandline(); |
| 479 | + |
| 480 | + // GH#12842: |
| 481 | + // With the commandline field on the user profile gone, it's actually unknown what |
| 482 | + // commandline it'll inherit, since a user profile can have multiple parents. We have to |
| 483 | + // make sure we restore the correct commandline in case we don't inherit the expected one. |
| 484 | + if (profile->Commandline() != patch.after) |
| 485 | + { |
| 486 | + profile->Commandline(winrt::hstring{ patch.after }); |
| 487 | + } |
| 488 | + |
| 489 | + fixedUp = true; |
| 490 | + break; |
| 491 | + } |
| 492 | + } |
473 | 493 | }
|
474 | 494 |
|
475 |
| - for (const auto& patch : commandlinePatches) |
| 495 | + if (profile->HasIcon() && profile->HasSource() && profile->Source() == VisualStudioGenerator::Namespace) |
476 | 496 | {
|
477 |
| - if (profile->Guid() == patch.guid && til::equals_insensitive_ascii(profile->Commandline(), patch.before)) |
| 497 | + for (auto&& icon : iconsToClearFromVisualStudioProfiles) |
478 | 498 | {
|
479 |
| - profile->ClearCommandline(); |
480 |
| - |
481 |
| - // GH#12842: |
482 |
| - // With the commandline field on the user profile gone, it's actually unknown what |
483 |
| - // commandline it'll inherit, since a user profile can have multiple parents. We have to |
484 |
| - // make sure we restore the correct commandline in case we don't inherit the expected one. |
485 |
| - if (profile->Commandline() != patch.after) |
| 499 | + if (profile->Icon() == icon) |
486 | 500 | {
|
487 |
| - profile->Commandline(winrt::hstring{ patch.after }); |
| 501 | + profile->ClearIcon(); |
| 502 | + fixedUp = true; |
| 503 | + break; |
488 | 504 | }
|
489 |
| - |
490 |
| - fixedUp = true; |
491 |
| - break; |
492 | 505 | }
|
493 | 506 | }
|
494 | 507 | }
|
|
0 commit comments