From 8052911861883c9e3d1187529a72b72921f27746 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Mon, 27 Dec 2021 14:16:58 -0800 Subject: [PATCH] plugin/history: don't use `export` ...so the plugin is friendly to variables already marked read-only. --- plugins/available/history.plugin.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/available/history.plugin.bash b/plugins/available/history.plugin.bash index be253e4a..4c8cdaba 100644 --- a/plugins/available/history.plugin.bash +++ b/plugins/available/history.plugin.bash @@ -5,11 +5,11 @@ about-plugin 'improve history handling with sane defaults' # variable when the shell exits, rather than overwriting the file. shopt -s histappend -# erase duplicates; alternative option: export HISTCONTROL=ignoredups -export HISTCONTROL=${HISTCONTROL:-ignorespace:erasedups} +# erase duplicates; alternative option: HISTCONTROL=ignoredups +: "${HISTCONTROL:=ignorespace:erasedups}" # resize history to 100x the default (500) -export HISTSIZE=${HISTSIZE:-50000} +: "${HISTSIZE:=50000}" # Flush history to disk after each command. export PROMPT_COMMAND="history -a;${PROMPT_COMMAND}"