From d66e7b4a33541906d7bb7e1a1b89cff72f4e1572 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 2 May 2016 17:50:15 +0100 Subject: [PATCH] Upgrade history handling --- .bashrc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index 6201f53..146949f 100644 --- a/.bashrc +++ b/.bashrc @@ -18,8 +18,8 @@ shopt -s histappend shopt -s histverify # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) -HISTSIZE=1000 -HISTFILESIZE=2000 +HISTSIZE=4096 +HISTFILESIZE=4096 # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. @@ -71,6 +71,9 @@ prompt_colon() set_bash_prompt() { + # Update the history file after every command + # This prevents a loss of history in the case of an unclean exit + history -a PS1="${debian_chroot:+($debian_chroot)}${HOST_COLOUR}\u@\H\[\033[00m\]$(prompt_colon)\[\033[01;34m\]\w\[\033[00m\]" if [[ "$UID" = 0 ]]; then PS1="${PS1}# "