#1001300 Larger by-default HISTSIZE and HISTFILESIZE and setting shopt -s histappend in the .bashrc file

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
mYnDstrEAm
Date:
2021-12-07 23:36:04 UTC
Severity:
normal
#1001300#5
Date:
2021-12-07 23:34:08 UTC
From:
To:
Please set these variables to much larger values by-default. I think by default reliably no history entries should ever be lost or not get written across all sessions (including via measures such as always having a few kB of disk space reserved for these entries - filed a separate report about that; asked about a relevant loss of entries here: https://unix.stackexchange.com/q/582401/233262).

Furthermore, I think shopt -s histappend should also be set in the default .bashrc file. Overwriting instead of appending can cause data-loss and I see no good reasons for why this shouldn't be the default. Likewise, for HISTSIZE and HISTFILESIZE I think values on the order of 100000 aren't set because of concerns about file-size. But this shouldn't be a problem anymore. If there's a concern that too many entries are displayed when entering history in the command prompt the default output could be limited to e.g. 1000.

Lastly, just as an idea for further improvements once this is solved: there could also be a prompt once the bash history file approaches the HISTSIZE (just like the warning about a disk running full) and a maximum file-size. It would also be useful if one could change this variable in the GUI (in the case of KDE that's Konsole->Settings).

Many people have asked about losing history entries, there's no good reasons for why history is lost by default and having this set by default would make things easier for everyone (I won't link all forum posts where people asked about this after the fact just to learn about these variables and change them).