From 9c46a0688576dd8c67d2fc24b68c07402da14fc8 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 3 Jul 2025 19:10:42 +0200 Subject: shell: update HISTFILESIZE code to be actually useful "HISTFILESIZE=0" in profile wasn't working as intended, "unset HISTFILE" wasn't preventing creation of history files Now: HISTSIZE=n allows to reduce in-memory history buffer HISTFILESIZE=n allows to reduce history file size (0: truncate it) unset HISTFILE allows to not save history file at all function old new delta exitshell 138 194 +56 hush_exit 97 143 +46 save_history 266 296 +30 hush_main 1170 1186 +16 .rodata 105762 105771 +9 load_history 246 254 +8 size_from_HISTFILESIZE 44 41 -3 read_line_input 2746 2712 -34 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 6/2 up/down: 165/-37) Total: 128 bytes Signed-off-by: Denys Vlasenko --- shell/Config.src | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'shell/Config.src') diff --git a/shell/Config.src b/shell/Config.src index 5efbf9995..5b3fe08f3 100644 --- a/shell/Config.src +++ b/shell/Config.src @@ -166,9 +166,10 @@ config FEATURE_SH_HISTFILESIZE default y depends on SHELL_ASH || SHELL_HUSH help - This option makes busybox shells to use $HISTFILESIZE variable - to set shell history size. Note that its max value is capped - by "History size" setting in library tuning section. + This option makes busybox shells to use $HISTSIZE and + $HISTFILESIZE variables to set shell history size. + Note that its max value is capped by "History size" setting + in library tuning section. config FEATURE_SH_EMBEDDED_SCRIPTS bool "Embed scripts in the binary" -- cgit v1.2.3-55-g6feb