diff --git a/Terminal.Gui/App/ApplicationImpl.cs b/Terminal.Gui/App/ApplicationImpl.cs index 7c6b237df..f160c50cc 100644 --- a/Terminal.Gui/App/ApplicationImpl.cs +++ b/Terminal.Gui/App/ApplicationImpl.cs @@ -120,6 +120,18 @@ public partial class ApplicationImpl : IApplication // If an instance exists, reset it _instance?.ResetState (ignoreDisposed); + // Reset Application static properties to their defaults + // This ensures tests start with clean state + Application.ForceDriver = string.Empty; + Application.Force16Colors = false; + Application.IsMouseDisabled = false; + Application.QuitKey = Key.Esc; + Application.ArrangeKey = Key.F5.WithCtrl; + Application.NextTabGroupKey = Key.F6; + Application.NextTabKey = Key.Tab; + Application.PrevTabGroupKey = Key.F6.WithShift; + Application.PrevTabKey = Key.Tab.WithShift; + // Always reset the model tracking to allow tests to use either model after reset ResetModelUsageTracking (); }