1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:47:36 +00:00

Shell: Add an option to autosave history every N ms

...and set it to 10 seconds by default.
This commit is contained in:
Ali Mohammad Pur 2021-05-11 11:42:36 +04:30 committed by Linus Groh
parent 4d01183f5c
commit a527256356
4 changed files with 45 additions and 0 deletions

View file

@ -33,6 +33,13 @@ Note: This variable is respected by every program using `Line::Editor`, e.g. [`j
The value of this variable is used as the Shell's history file path, both for reading history at startup and writing history on exit.
Its default value is `~/.history`.
`HISTORY_AUTOSAVE_TIME_MS` (environment)
Setting this variable to a value `t` other than zero (0) will make the shell save the history to the history file every `t` milliseconds.
If `t` is not a non-negative integer, zero will be assumed.
Note that multiple shell instances will not interfere with each other if they are to save to the same history file, instead, the entries will all be merged together chronologically.
The default value for this option is set in `/etc/shellrc`.
## Visual
1. Prompting