diff --git a/kitty/history.c b/kitty/history.c index f2c15c9a0..c6902cbf1 100644 --- a/kitty/history.c +++ b/kitty/history.c @@ -180,6 +180,8 @@ historybuf_clear(HistoryBuf *self) { pagerhist_clear(self); self->count = 0; self->start_of_data = 0; + for (size_t i = 1; i < self->num_segments; i++) free_segment(self->segments + i); + self->num_segments = 1; } static bool