Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Terminal.Gui/Configuration/ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,14 @@ internal static void Initialize ()

foreach (KeyValuePair<string, ConfigProperty> hardCodedProperty in _hardCodedConfigPropertyCache)
{
// Set the PropertyValue to the hard coded value
// Set the PropertyValue to the hard coded value.
// Deep-clone the value to ensure the cache stores independent copies of reference types
// (e.g. Dictionary<,>). Without cloning, in-place mutations to a static property like
// Application.DefaultKeyBindings (e.g. dict[cmd] = ...) would silently corrupt the
// cached "hard-coded default", causing test-order-dependent failures.
hardCodedProperty.Value.Immutable = false;
hardCodedProperty.Value.UpdateToCurrentValue ();
hardCodedProperty.Value.PropertyValue = DeepCloner.DeepClone (hardCodedProperty.Value.PropertyValue);
hardCodedProperty.Value.Immutable = true;
}
}
Expand Down
Loading