microsoft / microsoft/terminal
Clear{Dark,Light}ColorSchemeName() does not clear a value inherited from a fragment parent
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
Description
### 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
- Origin resolution added in PR #20428 (`_originOfColorSchemeName()`) can help identify
the responsible layer if the fix needs to reach past the leaf.
Contributor guide
Research direction
Trace _validateAllSchemesExist() and the AppearanceConfig::ClearDarkColorSchemeName() and ClearLightColorSchemeName() entry points, then inspect _originOfColorSchemeName() for how fragment-parent ownership is represented. The fix is complete when a broken scheme reference falls back to the default even when its name was inherited from a fragment parent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 56/100