1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:07:44 +00:00

LibLine: Handle history across multiple concurrent sessions better

- Store history entries as (timestamp)::(entry)\n\n
- Merge the entries together when saving to avoid loss of history
  entries

To ideally make having two concurrently open shells
(or `js` repls or whatever) not overwrite each others' history entries.
This commit is contained in:
AnotherTest 2021-01-11 18:58:42 +03:30 committed by Andreas Kling
parent 711ced80c0
commit 510030971b
5 changed files with 88 additions and 18 deletions

View file

@ -463,7 +463,7 @@ int Shell::builtin_disown(int argc, const char** argv)
int Shell::builtin_history(int, const char**)
{
for (size_t i = 0; i < m_editor->history().size(); ++i) {
printf("%6zu %s\n", i, m_editor->history()[i].characters());
printf("%6zu %s\n", i, m_editor->history()[i].entry.characters());
}
return 0;
}