Skip to content

v0.2.36 — full history dedup is now move-to-front

Choose a tag to compare

@isene isene released this 23 May 23:02
· 28 commits to master since this release

Up-arrow finds the just-run command, even if it existed earlier in history

With `history_dedup = full`, `add_history` previously dropped a new entry on the floor if the same string already existed anywhere in history. The user-visible bug: typing `p` (or any common command) then pressing Up didn't bring back the just-run `p` — Up replayed whatever was on top before, because the new `p` was silently discarded as a duplicate.

v0.2.36 switches to move-to-front: when a new entry matches an older occurrence at index K, `hist_lines[K+1..count]` shifts down one slot to remove the older copy, `hist_count` is decremented, and the new entry lands at the tail via the normal append path. Up now retrieves the most recently used command, regardless of how long ago it was first seen.

`hist_dirty` is set on every removal so the next `save_history` routes through `rewrite_history` — the append-only fast path can't represent a deletion.

Smart-mode is unchanged (it only matches the immediate previous entry, which IS already the most recent — move-to-front would be a no-op there).