From 430f1f0b9ab56d3a7e877a6cbce75a0318dd22d4 Mon Sep 17 00:00:00 2001 From: Andrew Coleman Date: Thu, 11 Aug 2022 13:12:14 -0400 Subject: [PATCH] still use history -a and number/timestamp history entries even when using atuin --- dot_config/bash/history.sh | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/dot_config/bash/history.sh b/dot_config/bash/history.sh index 1bad996..be8e47e 100644 --- a/dot_config/bash/history.sh +++ b/dot_config/bash/history.sh @@ -1,3 +1,24 @@ +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +## +## history: http://mywiki.wooledge.org/BashFAQ/088 +## + +# Big history +HISTFILESIZE=10000 +HISTSIZE=10000 +HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S " + +# history -a causes an immediate write of all new history lines +# (instead of upon shell exit) +PROMPT_COMMAND="history -a; ${PROMPT_COMMAND}" + +# histappend which causes all new history lines to be appended, and ensures +# that multiple logins do not overwrite each other's history +shopt -s histappend + if which atuin > /dev/null 2>&1 ; then ATUIN_SESSION=$(atuin uuid) export ATUIN_SESSION @@ -33,25 +54,4 @@ if which atuin > /dev/null 2>&1 ; then if [[ -z $ATUIN_NOBIND ]]; then bind -x '"\C-r": __atuin_history' fi -else - # don't put duplicate lines or lines starting with space in the history. - # See bash(1) for more options - HISTCONTROL=ignoreboth - - ## - ## history: http://mywiki.wooledge.org/BashFAQ/088 - ## - - # Big history - HISTFILESIZE=10000 - HISTSIZE=10000 - HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S " - - # history -a causes an immediate write of all new history lines - # (instead of upon shell exit) - PROMPT_COMMAND="history -a" - - # histappend which causes all new history lines to be appended, and ensures - # that multiple logins do not overwrite each other's history - shopt -s histappend fi