Skip to content

Commit 8fa98f6

Browse files
carlos-zamoraDHowett
authored andcommitted
Fix hiding the icon when it's set to "none" (#18030)
The settings UI and settings model allow you to set the icon to "none" to hide the icon (you can actually see this effect in the settings UI when changing the value of the profile icon). However, during settings validation, "none" is considered a file path, which is then failed to be parsed, resulting in the icon being marked as invalid and immediately clearing the value. This PR fixes this issue by considering "none" to be an accepted value during validation. Related to #15843 Closes #17943 ## Validation Steps Performed When an icon is set to "none", ... ✅ no more warning ✅ the icon is hidden (cherry picked from commit 36f064c) Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgTyV8E Service-Version: 1.22
1 parent b947d1a commit 8fa98f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cascadia/TerminalSettingsModel/CascadiaSettings.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,9 @@ void CascadiaSettings::_validateMediaResources()
531531
// Explicitly just use the Icon here, not the EvaluatedIcon. We don't
532532
// want to blow up if we fell back to the commandline and the
533533
// commandline _isn't an icon_.
534-
if (const auto icon = profile.Icon(); icon.size() > 2)
534+
// GH #17943: "none" is a special value interpreted as "remove the icon"
535+
static constexpr std::wstring_view HideIconValue{ L"none" };
536+
if (const auto icon = profile.Icon(); icon.size() > 2 && icon != HideIconValue)
535537
{
536538
const auto iconPath{ wil::ExpandEnvironmentStringsW<std::wstring>(icon.c_str()) };
537539
try

0 commit comments

Comments
 (0)