addHistory method
Records line in the history (subject to CommandHistory.add rules) and
resets the navigation cursor to the newest entry.
Implementation
Future<void> addHistory(String line) async {
await _history.add(line);
_resetHistoryNav();
}