ash.c history loading and ENABLE_FEATURE_EDITING_SAVEHISTORY

Kang-Che Sung explorer09 at gmail.com
Sun Dec 24 00:10:26 UTC 2017


2017-12-24 07:55,"Ceriel Jacobs" <linux-ide at crashplan.pro>寫道:

It seems that BusyBox v1.27.2 doesn't load history from a history file when
ENABLE_FEATURE_EDITING_SAVEHISTORY is not set.

I think that the corresponding source code logic is here:
<https://git.busybox.net/busybox/tree/shell/ash.c#n13950>

Such logic doesn't match the feature name, which is ...SAVEHISTORY and not
...LOADHISTORY.

For example:
Busybox is often used in (emergency/disaster) recovery environments. There
is no need for any saving (readonly media). However it comes handy when
frequently used commands can be pre-loaded into the initramfs (for
interactive logins).

Is such a loadhistory-without-savehistory scenario tackled when changing:

#if MAX_HISTORY > 0 && ENABLE_FEATURE_EDITING_SAVEHISTORY

to

#if MAX_HISTORY > 0

in ash.c?

In case it is not, what more to change to allow loading a HISTFILE when
ENABLE_FEATURE_EDITING_SAVEHISTORY is not set?


What's the point of loading frequently used commands if you don't save what
you have typed *just now*? You can have .ash_history in a temp filesystem
if you like, but it still counts as saving the history.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20171224/f4d6905c/attachment.html>


More information about the busybox mailing list