From a81341a3b652f7635240a66bf1ff1ffb5059347c Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 5 Dec 2025 05:03:00 +0000
Subject: [PATCH] Make IDriver.Force16Colors get-only as per code review
- Changed IDriver.Force16Colors from get/set to get-only
- Simplified DriverImpl.Force16Colors implementation to remove setter
- Updated documentation to clarify Force16Colors is read-only per driver instance
- Addresses code review feedback about inconsistent interface declaration
Co-authored-by: tig <585482+tig@users.noreply.github.com>
---
Terminal.Gui/Drivers/DriverImpl.cs | 6 +-----
Terminal.Gui/Drivers/IDriver.cs | 6 +++++-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Terminal.Gui/Drivers/DriverImpl.cs b/Terminal.Gui/Drivers/DriverImpl.cs
index 1a921fecc..f3186ac89 100644
--- a/Terminal.Gui/Drivers/DriverImpl.cs
+++ b/Terminal.Gui/Drivers/DriverImpl.cs
@@ -206,11 +206,7 @@ internal class DriverImpl : IDriver
public bool SupportsTrueColor => true;
///
- bool IDriver.Force16Colors
- {
- get => _instanceForce16Colors || !SupportsTrueColor;
- set => throw new InvalidOperationException ("Force16Colors is read-only per driver instance. Set Terminal.Gui.Drivers.Driver.Force16Colors static property before driver creation.");
- }
+ public bool Force16Colors => _instanceForce16Colors || !SupportsTrueColor;
///
public bool GetForce16Colors () => _instanceForce16Colors || !SupportsTrueColor;
diff --git a/Terminal.Gui/Drivers/IDriver.cs b/Terminal.Gui/Drivers/IDriver.cs
index 26ec56a7e..b6c80ce22 100644
--- a/Terminal.Gui/Drivers/IDriver.cs
+++ b/Terminal.Gui/Drivers/IDriver.cs
@@ -93,8 +93,12 @@ public interface IDriver
/// Will be forced to if is
/// , indicating that the cannot support TrueColor.
///
+ ///
+ /// This property is read-only. To change the Force16Colors setting, set
+ /// Terminal.Gui.Drivers.Driver.Force16Colors before creating the driver instance.
+ ///
///
- bool Force16Colors { get; set; }
+ bool Force16Colors { get; }
///
/// Gets whether the is using 16 colors instead of TrueColors.