add a container symbol prefix

This commit is contained in:
Jens Petersen 2023-11-11 18:00:34 +08:00
parent 501831219f
commit d50be4acd4
2 changed files with 7 additions and 2 deletions

View File

@ -16,5 +16,7 @@ if [ '(' "$PS1" = "[\u@\h \W]\\$ " -o "$PS1" = "\\s-\\v\\\$ " ')' -a "${TERM: -5
# PROMPT_COLOR='1;33;44' # bold yellow on blue
# PROMPT_COLOR='1;32' # bold green
# PROMPT_COLOR='' # unset defaults to green
PS1='${PROMPT_BRACKETS:+[}\[\e[${PROMPT_COLOR:-32}m\]\u@\h\[\e[0m\]:\[\e[${PROMPT_DIR_COLOR:-${PROMPT_COLOR:-32}}m\]\w${PROMPT_ERROR:+\[\e[0;31m\]${?#0}}\[\e[0m\]${PROMPT_BRACKETS:+]}\$ '
PS1='${PROMPT_BRACKETS:+[}\[\e[${PROMPT_COLOR:-32}m\]${container:+⬢ }\u@\h\[\e[0m\]:\[\e[${PROMPT_DIR_COLOR:-${PROMPT_COLOR:-32}}m\]\w${PROMPT_ERROR:+\[\e[0;31m\]${?#0}}\[\e[0m\]${PROMPT_BRACKETS:+]}\$ '
fi

View File

@ -1,5 +1,5 @@
Name: shell-color-prompt
Version: 0.2
Version: 0.2.1
Release: 1%{?dist}
Summary: Color prompt for bash shell
@ -41,6 +41,9 @@ install -m 644 -D -t %{buildroot}%{profiledir} bash-color-prompt.sh
%changelog
* Sat Nov 11 2023 Jens Petersen <petersen@redhat.com> - 0.2.1-1
- add a container symbol prefix
* Fri Nov 10 2023 Jens Petersen <petersen@redhat.com> - 0.2-1
- add PROMPT_DIR_COLOR to change the dir color (Thomas Steenholdt, #2239152)
- also check for bash default prompt for login shell (Sam Morris, #2248853)