1
0
Fork 0

.bashrc: add persistent history and fix PROMPT_COMMAND

main
urosm 2024-09-13 20:18:45 +02:00
parent adcefe76ce
commit 660fcdfd80
1 changed files with 8 additions and 1 deletions

View File

@ -18,6 +18,13 @@ alias ll="ls -AF1"
alias lll="ls -AFlh" alias lll="ls -AFlh"
alias ff="find 2>/dev/null" alias ff="find 2>/dev/null"
# history
HISTCONTROL="ignoreboth:erasedups"
HISTFILESIZE="-1"
HISTIGNORE="q"
shopt -s histappend
PROMPT_COMMAND=${PROMPT_COMMAND:+${PROMPT_COMMAND%;}; }"history -a; history -c; history -r;"
# bash completion # bash completion
if ! shopt -oq posix; then if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then if [ -f /usr/share/bash-completion/bash_completion ]; then
@ -42,4 +49,4 @@ osc7_cwd() {
done done
printf '\e]7;file://%s%s\e\\' "${HOSTNAME}" "${encoded}" printf '\e]7;file://%s%s\e\\' "${HOSTNAME}" "${encoded}"
} }
PROMPT_COMMAND="osc7_cwd; $PROMPT_COMMAND" PROMPT_COMMAND=${PROMPT_COMMAND:+${PROMPT_COMMAND%;}; }osc7_cwd