aboutsummaryrefslogtreecommitdiffstats
path: root/hyperterm/themes/special.sh
diff options
context:
space:
mode:
Diffstat (limited to 'hyperterm/themes/special.sh')
-rw-r--r--hyperterm/themes/special.sh21
1 files changed, 13 insertions, 8 deletions
diff --git a/hyperterm/themes/special.sh b/hyperterm/themes/special.sh
index fd58b1e..7ad71f8 100644
--- a/hyperterm/themes/special.sh
+++ b/hyperterm/themes/special.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# shellcheck disable=SC1117
+# shellcheck disable=SC1117,SC2034,SC2154
unset special
@@ -17,19 +17,24 @@ _prompt_local_name() {
esac
}
-special=("\n\
+PROMPT_COMMAND='
+ last_status=$?
+ ps1_status="$(exitstatus "$last_status")"
+ ps1_loc="$(_prompt_local_name)"
+ ps1_git="$(__prompt_git)"
+'
+
+special="\n\
\[$RESET\]\
-\[${BOLD}${YELLOW}\][$(_prompt_local_name)\
+\[${BOLD}${YELLOW}\][\${ps1_loc}\
\[$RESET\] \[${BOLD}${GREY}\]\w\
\[${BOLD}${YELLOW}\]]\[$RESET\] \
\[${BOLD}${CYAN}\]hist:\!\[$RESET\]\n\
\[${BOLD}${GREY}\]\
\D{%Y-%m-%d}@\D{%I:%M%p}\[$RESET\] \
-\$(exitstatus)\[$RESET\]\
-\$(__prompt_git)\n\
-\[${BOLD}${GREEN}\]$SYMBOL \[$RESET\]")
-
-export special
+\${ps1_status}\[$RESET\]\
+\${ps1_git}\n\
+\[${BOLD}${GREEN}\]$SYMBOL \[$RESET\]"
unset _psi
: "${_psi:=\[${BOLD}${CYAN}\]=>\[$RESET\] }"