diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rwxr-xr-x | zuwu.zsh | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index ae54429..e7cccb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ Items here can change in various ways, and changes introduced here should not be - Use `which` to detect `compinit` ([`396a5a7`](https://git.estrogen.zone/zuwu.git/commit/?id=396a5a7fb6274d61586a48272f977dab426b1a55)) - Give `SAVEHIST` the same treatment as `HISTFILE` for initialization of `.zshrc` section ([`c9a27c6`](https://git.estrogen.zone/zuwu.git/commit/?id=c9a27c6a5a29077525db86b955d04ab21bf18f59)) + - Also applies if it's zero now; if you really want a nonexistent history, set `AVOID_SETTING_HIST_INFO=true` in your config. ## v0.3.1 [`1221d0f`](https://git.estrogen.zone/zuwu.git/commit/?id=1221d0f52243ceb94b024ac64f3f36da1ec66b9f) @@ -294,8 +294,9 @@ __sethist # History Size Determination if [[ "$AVOID_SETTING_HIST_INFO" == "" ]]; then - if ! [ -n "${HISTSIZE+1}" ] || ! [ -n "${SAVEHIST+1}" ]; then - eval_append ~/.zshrc "$(<<EOF + if ! [ -n "${HISTSIZE+1}" ] || ! [ -n "${SAVEHIST+1}" ] || [[ "$SAVEHIST" == "0" ]] || [[ "$HISTSIZE" == "0" ]]; then + if ! grep "Lines configured by zsh-newuser-install" ~/.zshrc >/dev/null 2>/dev/null; then + eval_append ~/.zshrc "$(<<EOF # Lines configured by zsh-newuser-install HISTFILE="~/.histfile" HISTSIZE="10000" @@ -306,6 +307,7 @@ SAVEHIST="10000" typeset -f __sethist >/dev/null 2>/dev/null && __sethist || true EOF )" + fi fi fi |