Skip to content

grml-zsh-config does not check if history related variables have been set before setting them #160

Closed
@unknowndevQwQ

Description

grml-etc-core/etc/zsh/zshrc

Lines 1683 to 1685 in bdc51f9

HISTFILE=${HISTFILE:-${ZDOTDIR:-${HOME}}/.zsh_history}
isgrmlcd && HISTSIZE=500 || HISTSIZE=5000
isgrmlcd && SAVEHIST=1000 || SAVEHIST=10000 # useful for setopt append_history

I switched to grml's zshrc and used it for quite some time before noticing that the history size was much smaller than what was defined in /etc/profile.d. I'm going to submit a PR for this, but I'm not sure which of the three ways to change the HISTSIZE and SAVEHIST variables I should choose.

[[ -z "${HISTFILE}" ]] && HISTFILE=${HISTFILE:-${ZDOTDIR:-${HOME}}/.zsh_history} 
if [[ -z "${HISTSIZE}" ]]; then
  isgrmlcd && HISTSIZE=500  || HISTSIZE=5000
fi
if [[ -z "${SAVEHIST}" ]]; then
  isgrmlcd && SAVEHIST=1000 || SAVEHIST=10000 # useful for setopt append_history 
fi
[[ -z "${HISTSIZE}" ]] && { isgrmlcd && HISTSIZE=500  || HISTSIZE=5000; }
[[ -z "${SAVEHIST}" ]] && { isgrmlcd && SAVEHIST=1000 || SAVEHIST=10000; } # useful for setopt append_history 
isgrmlcd && HISTSIZE=500  || HISTSIZE=${HISTSIZE:-5000}
isgrmlcd && SAVEHIST=1000 || SAVEHIST=${SAVEHIST:-10000} # useful for setopt append_history 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions