shfmt agnoster theme
parent
ae9da3b62b
commit
60da498ed4
|
|
@ -71,7 +71,7 @@ PROMPT_DIRTRIM=2 # bash4 and above
|
|||
DEBUG=0
|
||||
debug() {
|
||||
if [[ ${DEBUG} -ne 0 ]]; then
|
||||
>&2 echo -e $*
|
||||
echo >&2 -e $*
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ bg_color() {
|
|||
cyan) echo 46 ;;
|
||||
white) echo 47 ;;
|
||||
orange) echo 48\;5\;166 ;;
|
||||
esac;
|
||||
esac
|
||||
}
|
||||
|
||||
# TIL: declare is global not local, so best use a different name
|
||||
|
|
@ -210,18 +210,17 @@ prompt_virtualenv() {
|
|||
if [[ -n $VIRTUAL_ENV ]]; then
|
||||
color=cyan
|
||||
prompt_segment $color $PRIMARY_FG
|
||||
ve=`basename "$VIRTUAL_ENV"`
|
||||
ve=$(basename "$VIRTUAL_ENV")
|
||||
prompt_segment $color white "$ve"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
### Prompt components
|
||||
# Each component will draw itself, and hide itself if no information needs to be shown
|
||||
|
||||
# Context: user@hostname (who am I and where am I)
|
||||
prompt_context() {
|
||||
local user=`whoami`
|
||||
local user=$(whoami)
|
||||
|
||||
if [[ $user != $DEFAULT_USER || -n $SSH_CLIENT ]]; then
|
||||
prompt_segment black default "$user@\h"
|
||||
|
|
@ -234,7 +233,6 @@ prompt_histdt() {
|
|||
prompt_segment black default "\! [\A]"
|
||||
}
|
||||
|
||||
|
||||
git_status_dirty() {
|
||||
dirty=$(git status -s 2> /dev/null | tail -n 1)
|
||||
[[ -n $dirty ]] && echo " ●"
|
||||
|
|
|
|||
Loading…
Reference in New Issue