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:
parent
711ced80c0
commit
510030971b
5 changed files with 88 additions and 18 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue