Skip to content

Clear{Dark,Light}ColorSchemeName() does not clear a value inherited from a fragment parent #20462

Description

@drvoss

Description

When _validateAllSchemesExist() finds a broken color-scheme reference it calls
AppearanceConfig::ClearDarkColorSchemeName() / ClearLightColorSchemeName() to fall
back to the default. These clears only reset the leaf layer's local optional
(per IInheritable). If the effective name was inherited from a fragment parent,
the parent's value survives the clear, so the intended fallback never takes effect for
fragment-inherited references.

This is independent of the warning-suppression work in #11457 / PR #20428: that PR
correctly suppresses the warning for fragment-originated references, but the Clear*
call still runs unconditionally and silently fails to restore the fallback. It is a
pre-existing bug, split out from that PR's discussion to keep its scope to warning
classification.

Expected

After a broken/incomplete scheme reference is detected, the appearance falls back to the
default scheme regardless of which layer supplied the (broken) name.

Actual

For a fragment-inherited reference, the parent's value remains after Clear*, so no
fallback occurs.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-SettingsIssues related to settings and customizability, for console or terminalIssue-BugIt either shouldn't be doing this or needs an investigation.Priority-3A description (P3)Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions