You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TerminalHistory: inconsistent eviction policy between setMaxSize() and add() #115
TerminalHistory.add() has an asymmetric capacity eviction policy compared to setMaxSize():
setMaxSize(Integer) — when trimming an oversized list, removes from the front (remove(0), oldest-first / FIFO).
add() — when the list is already at capacity (size == maxSize), appends the new entry then immediately removes from the back (removeLast()), silently discarding the newest command (LIFO-on-add).
This asymmetry is counterintuitive: users who set a max size would reasonably expect that older entries are evicted to make room for newer ones, consistent with how setMaxSize() itself trims the list.
Suggested Fix
In add(), replace the removeLast() call with a removeFirst() (or remove(0)) before appending the new entry, so that capacity eviction is consistently FIFO (oldest entry discarded). Update the add() JavaDoc to explicitly document the eviction policy and reference setMaxSize(Integer).
Activity
javier-godoy commentedon Nov 11, 2026
@paodb @scardanzan Please unassign me from this issue, as I'm no longer involved in the project.