From 92cc0c6aa6e5e454fd84d1bd75b891663028ed1c Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Mon, 2 Aug 2021 11:43:56 -0700 Subject: [PATCH] Add bash history save on every command --- base/.config/bash/bashrc.d/bash.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/base/.config/bash/bashrc.d/bash.sh b/base/.config/bash/bashrc.d/bash.sh index 0b1eb32..d184eca 100644 --- a/base/.config/bash/bashrc.d/bash.sh +++ b/base/.config/bash/bashrc.d/bash.sh @@ -1,6 +1,11 @@ #!/usr/bin/env bash #ft=bash +# always save bash history before showing prompt; allow reloading bashrc +if [[ ! "$PROMPT_COMMAND" =~ "history -a" ]]; then + export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND" +fi + # Disable capslock if [[ -x $(which setxkbmap) ]] && [[ $(uname) == Linux ]]; then setxkbmap -option ctrl:nocaps