Making it visible when in a devshell via a prefix to the PS1
This commit is contained in:
1 parent
9a1f94f5f5
commit
b60aef689e
1 file changed
+8
-2
@@ -68,10 +68,16 @@
|
||||
local TIME=$(date +%H:%M)
|
||||
local git_status=$(git_full_status)
|
||||
|
||||
# Devshell indicator
|
||||
local DEV_PREFIX=""
|
||||
if [[ -n "$DEV_SHELL_NAME" ]]; then
|
||||
DEV_PREFIX="\[\033[1;36m\]($DEV_SHELL_NAME)\[\033[0m\] "
|
||||
fi
|
||||
|
||||
if [ $EXIT -eq 0 ]; then
|
||||
PS1="\[\033[0;90m\][$TIME]\[\033[0m\] \[\033[1;32m\]\u@\h\[\033[0m\]:\[\033[1;34m\]\w\[\033[1;33m\]$git_status\[\033[0m\] \$ "
|
||||
PS1="$DEV_PREFIX\[\033[0;90m\][$TIME]\[\033[0m\] \[\033[1;32m\]\u@\h\[\033[0m\]:\[\033[1;34m\]\w\[\033[1;33m\]$git_status\[\033[0m\] \$ "
|
||||
else
|
||||
PS1="\[\033[0;90m\][$TIME]\[\033[0m\] \[\033[1;32m\]\u@\h\[\033[0m\]:\[\033[1;34m\]\w\[\033[1;33m\]$git_status \[\033[1;31m\][ERR:$EXIT]\[\033[0m\] \$ "
|
||||
PS1="$DEV_PREFIX\[\033[0;90m\][$TIME]\[\033[0m\] \[\033[1;32m\]\u@\h\[\033[0m\]:\[\033[1;34m\]\w\[\033[1;33m\]$git_status \[\033[1;31m\][ERR:$EXIT]\[\033[0m\] \$ "
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user