diff --git a/bash-color-prompt.sh b/bash-color-prompt.sh index 826da4e..195df2d 100644 --- a/bash-color-prompt.sh +++ b/bash-color-prompt.sh @@ -4,7 +4,7 @@ # PROMPT_DIRTRIM=3 # only set for color terminals and if PS1 unchanged from bash or fedora defaults -if [ '(' "$PS1" = "[\u@\h \W]\\$ " -o "$PS1" = "\\s-\\v\\\$ " ')' -a '(' "${TERM: -5}" = "color" -o "${TERM}" = "linux" ')' -o -n "${bash_prompt_color_force}" ]; then +if [ -n "${BASH_VERSION}" -a '(' "$PS1" = "[\u@\h \W]\\$ " -o "$PS1" = "\\s-\\v\\\$ " ')' -a '(' "${TERM: -5}" = "color" -o "${TERM}" = "linux" ')' -o -n "${bash_prompt_color_force}" ]; then PROMPT_COLOR="${PROMPT_COLOR:-32}" PROMPT_USERHOST="${PROMPT_USERHOST:-\u@\h}" diff --git a/shell-color-prompt.spec b/shell-color-prompt.spec index ecb5484..049500e 100644 --- a/shell-color-prompt.spec +++ b/shell-color-prompt.spec @@ -1,5 +1,5 @@ Name: shell-color-prompt -Version: 0.4.1 +Version: 0.4.2 Release: 1%{?dist} Summary: Color prompt for bash shell @@ -41,6 +41,12 @@ install -m 644 -D -t %{buildroot}%{profiledir} bash-color-prompt.sh %changelog +* Fri Jun 7 2024 Jens Petersen - 0.4.2-1 +- test for BASH_VERSION to avoid running for other shells + (#2279643, Nathan Grennan) +- fix condition regression introduced by previous linux console change +- rename prompt_color_force variable to bash_prompt_color_force + * Thu Jan 25 2024 Jens Petersen - 0.4.1-1 - also enable for Linux console (TERM=linux)