Skip to content
Snippets Groups Projects
Commit 128dd8d6 authored by nimrod's avatar nimrod
Browse files

Fix bug, now the exit status is shown only once after a failed command.

parent be60a48b
No related branches found
No related tags found
No related merge requests found
...@@ -223,7 +223,8 @@ __prompt () { ...@@ -223,7 +223,8 @@ __prompt () {
endtime="$(date +%s)" endtime="$(date +%s)"
runduration="$(( endtime - starttime))" runduration="$(( endtime - starttime))"
[ "$runduration" -lt '10' ] || PS1="\\[\\e[1;96m[Run duration: $runduration]\\e[0m\\] $PS1" [ "$runduration" -lt '10' ] || PS1="\\[\\e[1;96m[Run duration: $runduration]\\e[0m\\] $PS1"
[ "$exitstatus" -eq '0' ] || PS1="\\[\\e[1;91m[Exit status: $exitstatus]\\e[0m\\] $PS1" [ "$exitstatus" -eq '0' ] || [ -z "${run_command:-}" ] || PS1="\\[\\e[1;91m[Exit status: $exitstatus]\\e[0m\\] $PS1"
unset run_command
fi fi
last_command='__prompt' last_command='__prompt'
unset starttime unset starttime
...@@ -239,6 +240,10 @@ __command_notifier () { ...@@ -239,6 +240,10 @@ __command_notifier () {
starttime="$(date +%s)" starttime="$(date +%s)"
elif [ -n "${last_finish:-}" ] elif [ -n "${last_finish:-}" ]
then then
if [ "${last_command:-}" != '_direnv_hook' ]
then
run_command='1'
fi
runduration="$(( endtime - last_finish ))" runduration="$(( endtime - last_finish ))"
if [ "$runduration" -gt '10' ] if [ "$runduration" -gt '10' ]
then then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment