From 2befaa1669891d1516e110c86e03826b41f0c335 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Tue, 13 Aug 2024 18:21:09 -0500 Subject: [PATCH] Switch to the new and beautiful VS Dev Shell icons (#17706) We got some new icons for Developer Command Prompt and Developer PowerShell from our friends over on Visual Studio! This pull request includes them in the package, and fixes up the VS dynamic profiles to reset any icons that matched the old paths. This may be a minor breaking change for user settings, but we're making the assumption that if they didn't change their VS profile icons from the defaults, they probably want to follow us to the new defaults. To prevent anything like this from happening again, we're going to stop serializing icons for stub profiles. I've also included a VS version of the PowerShell "black" icon which is currently unused, but can be used in the future for PS7+-based VS Dev Shell. Closes #17627 (cherry picked from commit 06c07ab50dd75af3e1a1afc51cb4c688190fda92) Service-Card-Id: 93531229 Service-Version: 1.21 --- .../ProfileIcons/vs-cmd.scale-100.png | Bin 0 -> 433 bytes .../ProfileIcons/vs-cmd.scale-150.png | Bin 0 -> 804 bytes .../ProfileIcons/vs-cmd.scale-200.png | Bin 0 -> 1267 bytes .../ProfileIcons/vs-powershell.scale-100.png | Bin 0 -> 758 bytes .../ProfileIcons/vs-powershell.scale-150.png | Bin 0 -> 1314 bytes .../ProfileIcons/vs-powershell.scale-200.png | Bin 0 -> 1807 bytes .../ProfileIcons/vs-pwsh.scale-100.png | Bin 0 -> 819 bytes .../ProfileIcons/vs-pwsh.scale-150.png | Bin 0 -> 1300 bytes .../ProfileIcons/vs-pwsh.scale-200.png | Bin 0 -> 1808 bytes .../CascadiaSettingsSerialization.cpp | 49 +++++++++++------- .../TerminalSettingsModel/Profile.cpp | 2 +- .../VisualStudioGenerator.cpp | 4 +- .../VisualStudioGenerator.h | 1 + .../TerminalSettingsModel/VsDevCmdGenerator.h | 2 +- .../VsDevShellGenerator.h | 2 +- 15 files changed, 38 insertions(+), 22 deletions(-) create mode 100644 src/cascadia/CascadiaPackage/ProfileIcons/vs-cmd.scale-100.png create mode 100644 src/cascadia/CascadiaPackage/ProfileIcons/vs-cmd.scale-150.png create mode 100644 src/cascadia/CascadiaPackage/ProfileIcons/vs-cmd.scale-200.png create mode 100644 src/cascadia/CascadiaPackage/ProfileIcons/vs-powershell.scale-100.png create mode 100644 src/cascadia/CascadiaPackage/ProfileIcons/vs-powershell.scale-150.png create mode 100644 src/cascadia/CascadiaPackage/ProfileIcons/vs-powershell.scale-200.png create mode 100644 src/cascadia/CascadiaPackage/ProfileIcons/vs-pwsh.scale-100.png create mode 100644 src/cascadia/CascadiaPackage/ProfileIcons/vs-pwsh.scale-150.png create mode 100644 src/cascadia/CascadiaPackage/ProfileIcons/vs-pwsh.scale-200.png diff --git a/src/cascadia/CascadiaPackage/ProfileIcons/vs-cmd.scale-100.png b/src/cascadia/CascadiaPackage/ProfileIcons/vs-cmd.scale-100.png new file mode 100644 index 0000000000000000000000000000000000000000..9e712ad8d9521341a1c2274a581901c86d665a2a GIT binary patch literal 433 zcmV;i0Z#sjP)Px#32;bRa{vGf6951U69E94oEQKA0Y*tgK~y-)V_={Z z^iP`ppArl<;PTA}1aU^?L<|~kz^OB5$-;00fIcA$Q{Mm>Kv#%O48s6qMKCrx4aN6? z*a3(YfO_|1H2@7y07^LkF-YTkAT}rnSYAIl`^fq8)4wYaazVlBn)?o`>mD`$*#aQV zg#k4WSA6#W#aVyv5efr_B)5tG*VI0^zq0!N`O@H3`T71!|L6HHy}!Bn(fac< zei4iXhG@sG|En7A8?30l_ij$nrT;}i%kO6dELS)^^=HG`=|71vp!~D+kXmxLm)q^5*&D b{ofS;9dXg?|4C_+00000NkvXXu0mjf_ZYuF literal 0 HcmV?d00001 diff --git a/src/cascadia/CascadiaPackage/ProfileIcons/vs-cmd.scale-150.png b/src/cascadia/CascadiaPackage/ProfileIcons/vs-cmd.scale-150.png new file mode 100644 index 0000000000000000000000000000000000000000..82aa697c74f8e2806e48123d7fb12591de038735 GIT binary patch literal 804 zcmV+<1Ka$GP)Px#32;bRa{vGf6951U69E94oEQKA0=Y>J2p(0tHr}P|>ub)H96w%W?nw(`I*f+GICm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rA~N0G^9{gNaXZ(aZ1|O#P_kfbu!Eug8MJ)zEtE?}paKKn>>1aX<^Db7)L*^; z=x_r}t5_j6Hyi5hNMH91^tDgn=C$vjOv0!<>w*|B5ovt_(21^!I}m@*g>q`le6MO1 z^mR{R?2BJuwB~0Rsj)SC0xW8G5vShWeV?uXO^r|EVgp+C0EQ}8IDnCw4H&7mA?C(U zYS)T{fa1#tGb2wQ=sjA~lOJ!(KIUse1Kg|lZzt2c-_+^bs0P^;4nZ5GaH z{)BmrW1qAF@{Qiqa@%p-Z+rJ+_+cyiX`TiYG9%91i172yR?3V?V`U zT)7T|m23NbWecX+o>wrd!RmR%-MUNsH+nR`MIKdw&Sf`<6tYP(0jT`QXeWKo`^{9Z zB{Nm)TNnThDpo;LGKYTX-hm&nIcWvl--#0PV4L+=0p002ovPDHLkV1n0SIPU-e literal 0 HcmV?d00001 diff --git a/src/cascadia/CascadiaPackage/ProfileIcons/vs-powershell.scale-100.png b/src/cascadia/CascadiaPackage/ProfileIcons/vs-powershell.scale-100.png new file mode 100644 index 0000000000000000000000000000000000000000..54a8c126ff7e42a5a4557da75d02f9787ac5ef6e GIT binary patch literal 758 zcmVPx#32;bRa{vGf6951U69E94oEQKA0*gsRK~y-)#Zyg4 zlwlBl-uL~!Z@=Aj-BsMx$aJkhp$*rAcyvv=1ceepV32~BPOY7U3IidcOIw!?5xJ2S zU9>I|L@OR7f>O&%D7GDoD9N97_j})&4!e2{x->A%49q;wGcW`EZxee-DxHfPgK-GO zN-80g%>qhD%VwdZkjjRT79cE0si2e%mNLH&aB}S9!|DTxq0Sb<`Zta58yZ9!OyvmD zAmi=VY&2{)oR@n5(g`NPgkuMRi2)nY5P>U=8IKB6$(En&PuWgP=1lNZcA{@Oz=Gow{Y5&)DP zXs5jfHi(57>C+JaK-iBvg`HnLOghhGHYDr*#M)YS@7nw6#e0RgOr;m&(sGi_2Fw~= zM=jhPsY6|`h^g77(Y43LnM>78DQ}lL40KOob+sG7c+mAHrE=a#;X}Jn4g!|JNN*5V z2Ws&8?Pm;Le}(g>Ix@5GUgiYzg^R&Ru5&%#O^ggNeT_z$l+2fe>}ja2UnXWq*lvnQV`^>#XRpm;cEyKq ztQAap|5z867O=SbLAbVy_9GqK6>kGTY=~J3@?KDBD@){Mop4(=5N@2b+)&o3icMA! z7(!0(mWui9;`S&r$4S_^pPRpvL?p!Do+aJ)JShYXF&D09W`;K&TwX~Na626IqcPg> oMf}SL-cNrT5BQzF!?C9RKh3LCLi)$N(f|Me07*qoM6N<$f*%V++W-In literal 0 HcmV?d00001 diff --git a/src/cascadia/CascadiaPackage/ProfileIcons/vs-powershell.scale-150.png b/src/cascadia/CascadiaPackage/ProfileIcons/vs-powershell.scale-150.png new file mode 100644 index 0000000000000000000000000000000000000000..66486474a598b5e604a83239f12274e049d75ee4 GIT binary patch literal 1314 zcmV+-1>O3IP)Px#32;bRa{vGf6951U69E94oEQKA1h+{Ht3t(wCL2_#h13<`?I(+Hx5EVLTosjt9$Ob z|JVJ_cP{+D5BIMV<5Q(>Em-9!*V zHkRZKkdQ^%+r@`>moG~ZQ^YJHGb~2THjrWoEJHCO>#b45`+WXpf~-C+0X@5qjVFBf zvpM(O>3ix*l_-|M^yd12V$*X$$m=&E8lRdS&FWiQR4OB9FLeR<(x+?eZmyu-ycBz` zN@wa5#ooLbK1uN#abdHA(Il;*o&w1@dvTQ~&#VA&{Lx$4yCd|#O9wX`^;P!?BQD81 zGv65698o%+6k9-snUx?i&R)FE$!Ff9UUye2}(s!UC>SJTEoDjt8J$+sTb zLA~$*PoDkR)#29A`-d@`mm+4iq|_!xU+o+*$8@b2X#0@PUij(twlC|yF@g_OiS?t} zyCd+E$8X`mgM++tWtrcde|_>d-|Wl`DqQ$Ny6uPe`1~-Y8O83zfy-}xUT9h%$pE(} zgzTIHc;JcGl-0N0h{qzI`FNd&Ke2^+;W_u>8+_;F`Offb|2PnGe|7Ax`&BC%nAt)= zhn{`q{J1lBs_Yr?(S7^p?%6*&Cba19|N4dTkmk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png new file mode 100644 index 0000000000000000000000000000000000000000..57615ac57ee3f340d32d2c7734805934dee9ff5c GIT binary patch literal 1300 zcmV+v1?&2WP)Px#32;bRa{vGf6951U69E94oEQKA1gS|xK~zY`?Ui|K zRaFp&zw@rNwYCKzqJTgPr63erC{+?dpg7=pCz@W9z9;7GkD*IcR1j)c#yQTI$7X>&TIb|iK$wbp4%vtz30DaQC^XdFqsG9ICyq0JM ziJab})5AS(88{gQh>~%!;$o7jpel%3cI-RI?2lFg@K|=g%jH z#BJ0uYFlzWecnPYl>Gw0bNNp)Y}DAOdtxA!5_HqLbnDXthh0$shK!2x@}w5Odo8xK z9!ZG_Y+1XAzP-}{Xlx1wt~NR`!XDOhD>c}h_uA-HlO|@(IFx?uPIU_aa%!(sC&r#W zlHbP%X7c^MO$;8C1;GB}7ng1;tV=6Bu{%vXw>S(5Xs|i&)zPaaiNT+kaBr&5X>;K8 zs@thPfb!Ckp|@`}IT|CZ;xTXfD{Nj|3m7#tmpxyuh>CC8SIop2D><@rIY7Ih>*|TJWA9m!DurxUIpE-1rzom4s83(a zNzd9Ks;HtqRdQ;os}dvL?$axcl;rzpYzp$m$9tIfK_QhVx8ntG0e4VUbM24%DzW4# zGzgm3FE!IRJ_4R$#IhX|HiZ6mHC7Z~b=9TJhU@ilkruFa<5re${F;$3FJarpr8L!@ z4Y@_!u;GjX{8W07Qx(T=x?VH!aS04a&n354$OzVgsw$%R8g5+gAKOy`fdKPA^mF-S z5zUSDF)hFg^+D9!>hlPnfdMN}|5PTu_P*NV~y zRTQg{p%ED@k%1zJNKMt|voE>Ez0^MWAsnX-s1}3C&+3&u+`u}qqJo%|#DwCm9Xn@Z z%q8 literal 0 HcmV?d00001 diff --git a/src/cascadia/CascadiaPackage/ProfileIcons/vs-pwsh.scale-200.png b/src/cascadia/CascadiaPackage/ProfileIcons/vs-pwsh.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..d7f31d5d7150c0badc4eb857f8846a084baabb15 GIT binary patch literal 1808 z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nnAt>8e}|GfK(Vt3&RzWlnp%8>gK%#j*k=%o zi5buIRacfCSu%lFz&p2Y8nxBzWWj0JuwflkUN`~|s|uja_dqQ)N}|z7L*&j|cm^6I z)^)Q4Ni?al;@^sl`DI&G0#sHJBitzgOb;I1>l`elawLc?UTABq2O3bhR(eiCYXA`o zjNO*I6+>~7TvbU!^*v7#O6ei8pgi>KyXRfW%dlULWYU~NF+%chuxt>)^0ce9a=q5B z+v3Ped~Mom>)gh0lev4>=Ve(LyCo1}+mbh}Bx6yzSrFk8?u*0=3*n-*w)#urEhFQk z9|TNQ-9K-3TaFpCS{^cs#apf$rJ9&_Xu3yvpRu4c79;SKL;}OHxy8rghm9iGcv>Rl z-};4vL}ubpqy<;nZoA6{#Bfj|(Avo2Eu#o`Tx_ezv-%0P%kJU?_cXQoNc_-|XaT|T yiX$RTcvb}Fq>bK-C1_QcA^b0tK9Pg-^}hjGF%t>mHGh`?0000 - #include "ApplicationState.h" #include "DefaultTerminal.h" #include "FileUtils.h" @@ -460,6 +457,11 @@ bool SettingsLoader::FixupUserSettings() CommandlinePatch{ DEFAULT_WINDOWS_POWERSHELL_GUID, L"powershell.exe", L"%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" }, }; + static constexpr std::array iconsToClearFromVisualStudioProfiles{ + std::wstring_view{ L"ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png" }, + std::wstring_view{ L"ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png" }, + }; + auto fixedUp = userSettings.fixupsAppliedDuringLoad; fixedUp = RemapColorSchemeForProfile(userSettings.baseLayerProfile) || fixedUp; @@ -467,28 +469,39 @@ bool SettingsLoader::FixupUserSettings() { fixedUp = RemapColorSchemeForProfile(profile) || fixedUp; - if (!profile->HasCommandline()) + if (profile->HasCommandline()) { - continue; + for (const auto& patch : commandlinePatches) + { + if (profile->Guid() == patch.guid && til::equals_insensitive_ascii(profile->Commandline(), patch.before)) + { + profile->ClearCommandline(); + + // GH#12842: + // With the commandline field on the user profile gone, it's actually unknown what + // commandline it'll inherit, since a user profile can have multiple parents. We have to + // make sure we restore the correct commandline in case we don't inherit the expected one. + if (profile->Commandline() != patch.after) + { + profile->Commandline(winrt::hstring{ patch.after }); + } + + fixedUp = true; + break; + } + } } - for (const auto& patch : commandlinePatches) + if (profile->HasIcon() && profile->HasSource() && profile->Source() == VisualStudioGenerator::Namespace) { - if (profile->Guid() == patch.guid && til::equals_insensitive_ascii(profile->Commandline(), patch.before)) + for (auto&& icon : iconsToClearFromVisualStudioProfiles) { - profile->ClearCommandline(); - - // GH#12842: - // With the commandline field on the user profile gone, it's actually unknown what - // commandline it'll inherit, since a user profile can have multiple parents. We have to - // make sure we restore the correct commandline in case we don't inherit the expected one. - if (profile->Commandline() != patch.after) + if (profile->Icon() == icon) { - profile->Commandline(winrt::hstring{ patch.after }); + profile->ClearIcon(); + fixedUp = true; + break; } - - fixedUp = true; - break; } } } diff --git a/src/cascadia/TerminalSettingsModel/Profile.cpp b/src/cascadia/TerminalSettingsModel/Profile.cpp index 0f568b37e53..66382c857b1 100644 --- a/src/cascadia/TerminalSettingsModel/Profile.cpp +++ b/src/cascadia/TerminalSettingsModel/Profile.cpp @@ -329,7 +329,7 @@ Json::Value Profile::ToJson() const // Recall: Icon isn't actually a setting in the MTSM_PROFILE_SETTINGS. We // defined it manually in Profile, so make sure we only serialize the Icon // if the user actually changed it here. - JsonUtils::SetValueForKey(json, IconKey, (writeBasicSettings && HasIcon()) ? Icon() : _Icon); + JsonUtils::SetValueForKey(json, IconKey, _Icon); // PermissiveStringConverter is unnecessary for serialization JsonUtils::SetValueForKey(json, PaddingKey, _Padding); diff --git a/src/cascadia/TerminalSettingsModel/VisualStudioGenerator.cpp b/src/cascadia/TerminalSettingsModel/VisualStudioGenerator.cpp index 3fd3bca8a71..2fcfb1cc528 100644 --- a/src/cascadia/TerminalSettingsModel/VisualStudioGenerator.cpp +++ b/src/cascadia/TerminalSettingsModel/VisualStudioGenerator.cpp @@ -9,9 +9,11 @@ using namespace winrt::Microsoft::Terminal::Settings::Model; +std::wstring_view VisualStudioGenerator::Namespace{ L"Windows.Terminal.VisualStudio" }; + std::wstring_view VisualStudioGenerator::GetNamespace() const noexcept { - return std::wstring_view{ L"Windows.Terminal.VisualStudio" }; + return Namespace; } void VisualStudioGenerator::GenerateProfiles(std::vector>& profiles) const diff --git a/src/cascadia/TerminalSettingsModel/VisualStudioGenerator.h b/src/cascadia/TerminalSettingsModel/VisualStudioGenerator.h index 766d2cd7775..ef36284db74 100644 --- a/src/cascadia/TerminalSettingsModel/VisualStudioGenerator.h +++ b/src/cascadia/TerminalSettingsModel/VisualStudioGenerator.h @@ -26,6 +26,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model class VisualStudioGenerator : public IDynamicProfileGenerator { public: + static std::wstring_view Namespace; std::wstring_view GetNamespace() const noexcept override; void GenerateProfiles(std::vector>& profiles) const override; diff --git a/src/cascadia/TerminalSettingsModel/VsDevCmdGenerator.h b/src/cascadia/TerminalSettingsModel/VsDevCmdGenerator.h index dd5d42dba38..eab94e89546 100644 --- a/src/cascadia/TerminalSettingsModel/VsDevCmdGenerator.h +++ b/src/cascadia/TerminalSettingsModel/VsDevCmdGenerator.h @@ -41,7 +41,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model std::wstring GetProfileIconPath() const { - return L"ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png"; + return L"ms-appx:///ProfileIcons/vs-cmd.png"; } std::wstring GetProfileName(const VsSetupConfiguration::VsSetupInstance& instance) const; diff --git a/src/cascadia/TerminalSettingsModel/VsDevShellGenerator.h b/src/cascadia/TerminalSettingsModel/VsDevShellGenerator.h index b7d14e8b951..7557b503c0b 100644 --- a/src/cascadia/TerminalSettingsModel/VsDevShellGenerator.h +++ b/src/cascadia/TerminalSettingsModel/VsDevShellGenerator.h @@ -38,7 +38,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model std::wstring GetProfileIconPath() const { - return L"ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png"; + return L"ms-appx:///ProfileIcons/vs-powershell.png"; } std::wstring GetProfileName(const VsSetupConfiguration::VsSetupInstance& instance) const;