Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH v2 0/1] Useful default of HISTSIZE
- X-seq: zsh-workers 50607
- From: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Cc: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Felipe Contreras <felipe.contreras@xxxxxxxxx>
- Subject: [PATCH v2 0/1] Useful default of HISTSIZE
- Date: Tue, 6 Sep 2022 14:50:02 -0500
- Archived-at: <https://zsh.org/workers/50607>
- List-id: <zsh-workers.zsh.org>
If we are going to recommend to most new users to set HISTSIZE to 1000,
then it makes more sense to set that as default instead of 30. The less
options we bother new users with, the better.
We are not in 1990 anymore (when in fact the default was 128).
Felipe Contreras (1):
Increase default HISTSIZE to 1000
Etc/FAQ.yo | 17 +++++++----------
Functions/Newuser/zsh-newuser-install | 3 +--
StartupFiles/zshrc | 2 +-
configure.ac | 2 +-
4 files changed, 10 insertions(+), 14 deletions(-)
Range-diff against v1:
1: 95f64c276 < -: --------- Set SAVEHIST to $HISTSIZE by default
2: 747d23c8c ! 1: edef19cbd Increase default HISTSIZE to 1000
@@ Metadata
## Commit message ##
Increase default HISTSIZE to 1000
- If the default is sensible it's not necessary for the user to change it.
+ If the default is sensible then it's not necessary for the user to
+ change it.
+
+ Moreover, the FAQ is wrong: it says it's necessary to set HISTSIZE for
+ the history to saved, but it isn't. HISTSIZE by default is 30 and that's
+ enough to save the history, although not very useful. Therefore only
+ *two* variables need to be set.
+
+ This is even more clear after we remove HISTSIZE from the example, but
+ then the text "The simplest possibility is to set it to the same as
+ tt($HISTSIZE) as above" becomes problematic as the value of HISTSIZE is
+ not readily available.
+
+ The user doesn't need to know the value of HISTSIZE though, she can
+ simply use $HISTSIZE instead.
+
+ This has the advantage that if HISTSIZE is increased again in the future
+ (as it probably should because most modern computers can easily afford
+ orders of magnitude more), nobody needs to worry about SAVEHIST (neither
+ in the FAQ, zsh-newuser-install, or existing zshrc files).
+
+ Also, semantically makes more sense and carries less cognitive load.
Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
@@ Etc/FAQ.yo: work?)
verb(
- HISTSIZE=200
HISTFILE=~/.zsh_history
- SAVEHIST=$HISTSIZE
- )
+- SAVEHIST=200
+- )
- tt($HISTSIZE) tells the shell how many lines to keep internally,
- tt($HISTFILE) tells it where to write the history, and tt($SAVEHIST),
- the easiest one to forget, tells it how many to write out. The
- simplest possibility is to set it to the same as tt($HISTSIZE) as
- above. There are also various options affecting history; see the
- manual.
++ SAVEHIST=$HISTSIZE
++ )
+ tt($HISTFILE) tells the shell where to write the history, and tt($SAVEHIST)
+ tells it how many lines to write out. The simplest possibility is to set it
+ to the same as tt($HISTSIZE) as above. There are also various options
@@ Functions/Newuser/zsh-newuser-install: ${(F)unparsed}
__zni_apply_defaults -p \
- HISTSIZE 1000 "Number of lines of history kept within the shell." \
HISTFILE $zdmsg/.histfile "File where history is saved." \
- SAVEHIST \$HISTSIZE "Number of lines of history to save to \$HISTFILE."
+- SAVEHIST 1000 "Number of lines of history to save to \$HISTFILE."
++ SAVEHIST \$HISTSIZE "Number of lines of history to save to \$HISTFILE."
+ if __zni_display_and_edit "History configuration"; then
+ install_state[history]="Unsaved changes"
## StartupFiles/zshrc ##
@@ StartupFiles/zshrc: export HELPDIR=/usr/share/zsh/$ZSH_VERSION/help # directory for run-help functi
--
2.37.2.351.g9bf691b78c.dirty
Messages sorted by:
Reverse Date,
Date,
Thread,
Author