1
0
mirror of https://github.com/skeeto/w64devkit.git synced 2026-10-23 06:08:56 +03:00

busybox: Raise shell history limit to 16k, default to 1k

The busybox-w32 defconfig caps HISTSIZE at 1023 and defaults to 384,
which is cramped for desktop use. Nothing in the history code is worse
than linear. The one cost that scales with history is fork emulation:
each forkshell child of an interactive shell (command substitution,
subshell, pipeline stage) receives a copy of the in-memory history. At
10k entries that adds roughly 0.3 ms to a ~5 ms spawn. The cap itself
only sizes a fixed pointer array, so raising it is nearly free, and
the 1024 default stays well under 1% per fork.

Upstream Kconfig limits FEATURE_EDITING_HISTORY to 2000, and kconfig
treats out-of-range values as unset, so patch the range.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Christopher Wellons
2026-09-22 15:57:44 -04:00
parent 360636d5fb
commit 4bcc7c0d6d
3 changed files with 14 additions and 0 deletions

View File

@@ -742,6 +742,8 @@ RUN QUILT_PATCHES=$PREFIX/src/busybox quilt push -a \
-e 's/^# (CONFIG_BASH_IS_NONE) is not set/\1=y/' .config \
&& sed -ri 's/^(CONFIG_CRON\w*)=y/\1=n/' .config \
&& sed -ri 's/^(CONFIG_DPKG\w*)=y/\1=n/' .config \
&& sed -ri 's/^(CONFIG_FEATURE_EDITING_HISTORY)=.*/\1=16384/' .config \
&& sed -ri 's/^(CONFIG_FEATURE_EDITING_HISTORY_DEFAULT)=.*/\1=1024/' .config \
&& sed -ri 's/^(CONFIG_FEATURE_FAIL_IF_UTF8_MANIFEST_UNSUPPORTED)=y/\1=n/' .config \
&& sed -ri 's/^(CONFIG_FTP\w*)=y/\1=n/' .config \
&& sed -ri 's/^(CONFIG_LINK)=y/\1=n/' .config \

View File

@@ -0,0 +1,11 @@
--- a/libbb/Config.src
+++ b/libbb/Config.src
@@ -193,7 +193,7 @@
config FEATURE_EDITING_HISTORY
int "History size"
# Don't allow way too big values here, code uses fixed "char *history[N]" struct member
- range 0 2000
+ range 0 16384
default 200
depends on FEATURE_EDITING
help

View File

@@ -4,3 +4,4 @@ default-noiconify.patch
system-profile.patch
zstd.patch
mkdtemp.patch
history-limit.patch