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
History list mutations other than truncate() leave session_start_index stale #1788
History subclasses list and stores the current session boundary as a positional index, session_start_index. PR #1787 makes History.truncate() shift that index when it drops old items. Every other way of removing or inserting earlier items still leaves it pointing at the wrong place, including del hist[i], del hist[a:b], pop(), remove(), insert(), and slice assignment.
Unbounded ranges, str_search(), regex_search(), and the --all check in do_history all read the stale boundary.
Possible approaches:
Override the mutating list methods to adjust session_start_index.
Store the boundary in a form that doesn't depend on position, such as a count measured from the end, a reference to the first current-session HistoryItem, or a per-item "current session" flag.
The second approach is more robust, but session_start_index is a public attribute that tests and apps set directly, so compatibility needs some thought.
I’d like to work on this. I’m checking how removals and insertions affect the session boundary and preparing regression tests for the list mutation methods and slice assignment, while preserving the public session_start_index interface.
Activity
mayankdhingra02 commentedon Oct 30, 2026
I’d like to work on this. I’m checking how removals and insertions affect the session boundary and preparing regression tests for the list mutation methods and slice assignment, while preserving the public
session_start_indexinterface.