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
BIN
src/cascadia/CascadiaPackage/ProfileIcons/vs-cmd.scale-100.png
Normal file
|
After Width: | Height: | Size: 433 B |
BIN
src/cascadia/CascadiaPackage/ProfileIcons/vs-cmd.scale-150.png
Normal file
|
After Width: | Height: | Size: 804 B |
BIN
src/cascadia/CascadiaPackage/ProfileIcons/vs-cmd.scale-200.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 758 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
BIN
src/cascadia/CascadiaPackage/ProfileIcons/vs-pwsh.scale-100.png
Normal file
|
After Width: | Height: | Size: 819 B |
BIN
src/cascadia/CascadiaPackage/ProfileIcons/vs-pwsh.scale-150.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/cascadia/CascadiaPackage/ProfileIcons/vs-pwsh.scale-200.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
@ -20,9 +20,6 @@
|
||||
#include "SshHostGenerator.h"
|
||||
#endif
|
||||
|
||||
// userDefault.h is like the above, but with a default template for the user's settings.json.
|
||||
#include <LegacyProfileGeneratorNamespaces.h>
|
||||
|
||||
#include "ApplicationState.h"
|
||||
#include "DefaultTerminal.h"
|
||||
#include "FileUtils.h"
|
||||
@ -465,6 +462,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 = userSettings.globals->FixupsAppliedDuringLoad() || fixedUp;
|
||||
|
||||
@ -473,11 +475,8 @@ 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))
|
||||
@ -499,6 +498,20 @@ bool SettingsLoader::FixupUserSettings()
|
||||
}
|
||||
}
|
||||
|
||||
if (profile->HasIcon() && profile->HasSource() && profile->Source() == VisualStudioGenerator::Namespace)
|
||||
{
|
||||
for (auto&& icon : iconsToClearFromVisualStudioProfiles)
|
||||
{
|
||||
if (profile->Icon() == icon)
|
||||
{
|
||||
profile->ClearIcon();
|
||||
fixedUp = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Terminal 1.19: Migrate the global
|
||||
// `compatibility.reloadEnvironmentVariables` to being a per-profile
|
||||
// setting. If the user had it disabled in 1.18, then set the
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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<winrt::com_ptr<implementation::Profile>>& profiles) const
|
||||
|
||||
@ -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<winrt::com_ptr<implementation::Profile>>& profiles) const override;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||