Lift line editor construction out of loop (#5041)

Enables the use of some features on reedline

- Keeping the line when clearing the screen with `Ctrl-L`
- Using the internal cut buffer between lines
- Submitting external commands via keybinding and keeping the line

Additional effect:

Keep the history around and do basic syncs (performance improvement
minimal as session changes have to be read and written)

Additional change:

Give the option to defer writing/rereading the history file to the
closing of the session ($config.sync_history_on_enter)
This commit is contained in:
Stefan Holderbach
2022-03-31 23:25:48 +02:00
committed by GitHub
parent 6a6471b04b
commit 0986c61a5d
4 changed files with 63 additions and 41 deletions

View File

@ -196,7 +196,8 @@ let $config = {
use_ansi_coloring: true
filesize_format: "auto" # b, kb, kib, mb, mib, gb, gib, tb, tib, pb, pib, eb, eib, zb, zib, auto
edit_mode: emacs # emacs, vi
max_history_size: 10000
max_history_size: 10000 # Session has to be reloaded for this to take effect
sync_history_on_enter: true # Enable to share the history between multiple sessions, else you have to close the session to persist history to file
menu_config: {
columns: 4
col_width: 20 # Optional value. If missing all the screen width is used to calculate column width