From b489ac946ce91da14c7813398391f3b1d8460d74 Mon Sep 17 00:00:00 2001 From: Jon Kazama Date: Tue, 12 May 2026 13:41:38 +0200 Subject: [PATCH] fix(ux): reset input history on plugin dispose (F10.1) Static InputHistoryService entries used to survive a plugin reload because static field state doesn't get cleaned up on its own. The new Reset() method clears the list and is wired into Plugin.DisposeAsync alongside the existing pure-memory cleanups, so the next plugin load starts with an empty history instead of inheriting the previous session's typed commands. --- HellionChat/InputHistoryService.cs | 8 ++++++++ HellionChat/Plugin.cs | 2 ++ 2 files changed, 10 insertions(+) diff --git a/HellionChat/InputHistoryService.cs b/HellionChat/InputHistoryService.cs index d7d9300..833cc5c 100644 --- a/HellionChat/InputHistoryService.cs +++ b/HellionChat/InputHistoryService.cs @@ -41,4 +41,12 @@ public static class InputHistoryService return null; return _entries[cursor]; } + + // Plugin reload doesn't reset static state automatically. Plugin.DisposeAsync + // calls this so the next load starts with an empty history instead of + // inheriting the previous session's entries. + public static void Reset() + { + _entries.Clear(); + } } diff --git a/HellionChat/Plugin.cs b/HellionChat/Plugin.cs index b3a8e5e..f92652b 100755 --- a/HellionChat/Plugin.cs +++ b/HellionChat/Plugin.cs @@ -372,6 +372,8 @@ public sealed class Plugin : IAsyncDalamudPlugin failure = CaptureFailure(failure, () => Functions?.Dispose()); failure = CaptureFailure(failure, () => Commands?.Dispose()); failure = CaptureFailure(failure, () => EmoteCache.Dispose()); + // Static input history would otherwise survive the plugin reload. + failure = CaptureFailure(failure, InputHistoryService.Reset); if (failure is not null) ExceptionDispatchInfo.Capture(failure).Throw();