File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ export PATH_WIDTH=50
2929# set window title and terminal prompt
3030# embed git status information if available
3131set_prompt () {
32+ # emit BEL on non-zero exit codes, ignore SIGINT
33+ _exit=$? ; [ $_exit -gt 0 ] && [ $_exit -ne 130 ] && printf ' \a'
34+
3235 if [ ! -z $COLOR ]; then
3336 u=' \[\e[1;32m\]' # user/hostname color
3437 p=' \[\e[1;34m\]' # path color
@@ -46,9 +49,10 @@ set_prompt() {
4649 || path=" $( path-shorthand) " \
4750 || path=" ('${PWD##*/ } ' no longer exists)" # no such file or directory
4851 PS1=" \[\e]0;\u@\h: \w\a\]${u} \u@\h${r} :${git_path:- ${p}${path}${r} } \$ "
49- unset u p r path git_path
52+ unset _exit u p r path git_path
5053 export PROMPT_LATENCY=$(( ${EPOCHREALTIME% .* }${EPOCHREALTIME#* .} - TIME_NOW))
5154
55+
5256 # command history persistence across sessions
5357 history -a; history -c; history -r
5458}
You can’t perform that action at this time.
0 commit comments