mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2025-06-28 03:35:12 +00:00
Force bash history to be flushed before executing commands
This commit is contained in:
20
bashrc
Normal file
20
bashrc
Normal file
@ -0,0 +1,20 @@
|
||||
_postcmd()
|
||||
{
|
||||
AT_PROMPT=1
|
||||
history -a
|
||||
}
|
||||
PROMPT_COMMAND="_postcmd"
|
||||
|
||||
_precmd()
|
||||
{
|
||||
[ -z "$AT_PROMPT" ] && return
|
||||
unset AT_PROMPT
|
||||
history -a
|
||||
}
|
||||
trap _precmd DEBUG
|
||||
|
||||
shopt -s cmdhist
|
||||
shopt -s histappend
|
||||
unset HISTCONTROL
|
||||
export HISTFILESIZE=1000
|
||||
export HISTSIZE=1000
|
Reference in New Issue
Block a user