diff --git a/Core/Config.cs b/Core/Config.cs index 57b7b78..13dc6e9 100644 --- a/Core/Config.cs +++ b/Core/Config.cs @@ -460,7 +460,7 @@ public record class MitigationSettings /// This will prevent the title from being set if TERM has no xterm. /// /// - public Optional SuppressTitle = Optional.Default(true, true); + public Optional SuppressTitle = Optional.Default(TitleSuppression.Smart, true); /// /// @@ -673,6 +673,15 @@ public enum NetworkLimit Public, None } + + public enum TitleSuppression + { + Disabled, + Smart, + Enabled, + False = Disabled, + True = Smart + } } public record class LimiterConfig diff --git a/Core/Mitigations.cs b/Core/Mitigations.cs index c97c310..60923f7 100644 --- a/Core/Mitigations.cs +++ b/Core/Mitigations.cs @@ -329,11 +329,15 @@ private void TAHook_Mitigation_GameUpdate(EventArgs _) private void Detour_Mitigation_SetTitle(Action orig, TShockAPI.Utils self, bool empty) { var mitigation = this.config.Mitigation.Value; - if (!mitigation.DisableAllMitigation && mitigation.SuppressTitle) + if (!mitigation.DisableAllMitigation) { - if (ShouldSuppressTitle) + switch (mitigation.SuppressTitle.Value) { - return; + case Config.MitigationSettings.TitleSuppression.Enabled: + case Config.MitigationSettings.TitleSuppression.Smart when ShouldSuppressTitle: + { + return; + } } }