add method
Records entry, skipping blank lines and consecutive duplicates, then
persists the (trimmed-to-cap) history. IO failures are swallowed so the
interactive session is never interrupted by a disk error.
Implementation
@override
Future<void> add(String entry) async {
if (_buffer.add(entry)) await _persist();
}