diff options
author | H. P. <harald.pfeiffer _æ_ xmart.de> | 2018-11-01 13:30:58 +0100 |
---|---|---|
committer | H. P. <harald.pfeiffer _æ_ xmart.de> | 2018-11-01 13:30:58 +0100 |
commit | 0632591996893fe136a1f2fe44d9b9f404f41f3e (patch) | |
tree | 7340edbe7c212da3db45a83219147143a3268c8d /localfs/etc/profile.d/shellhist.sh | |
download | fedora-laptop-0632591996893fe136a1f2fe44d9b9f404f41f3e.tar.bz2 |
Initial commit
Diffstat (limited to 'localfs/etc/profile.d/shellhist.sh')
-rw-r--r-- | localfs/etc/profile.d/shellhist.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/localfs/etc/profile.d/shellhist.sh b/localfs/etc/profile.d/shellhist.sh new file mode 100644 index 0000000..4e377fd --- /dev/null +++ b/localfs/etc/profile.d/shellhist.sh @@ -0,0 +1,28 @@ +export HISTTIMEFORMAT="%F %T: " +export HISTSIZE=5000 +if [ -z "$PROMPT_COMMAND" ]; then + case $TERM in + xterm*|vte*) + if [ -e /etc/sysconfig/bash-prompt-xterm ]; then + PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm + elif [ "${VTE_VERSION:-0}" -ge 3405 ]; then + PROMPT_COMMAND="__vte_prompt_command" + else + PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"' + fi + ;; + screen*) + if [ -e /etc/sysconfig/bash-prompt-xterm ]; then + PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm + else + PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"' + fi + ;; + *) + [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default + ;; + esac +fi +# ...and now that we have the prompt, make sure history gets updated every time you fire away a command, +# not only on GRACEFUL session ends. +export PROMPT_COMMAND="history -a;history -c;history -r;$PROMPT_COMMAND" |