also enable for Linux console (TERM=linux)

This commit is contained in:
Jens Petersen 2024-01-25 18:57:24 +08:00
parent bb3bf018eb
commit 1dd8c6c16d
2 changed files with 5 additions and 2 deletions

View File

@ -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 -n "${prompt_color_force}" ]; then
if [ '(' "$PS1" = "[\u@\h \W]\\$ " -o "$PS1" = "\\s-\\v\\\$ " ')' -a "${TERM: -5}" = "color" -o "${TERM}" = "linux" -o -n "${prompt_color_force}" ]; then
PROMPT_COLOR="${PROMPT_COLOR:-32}"
PROMPT_USERHOST="${PROMPT_USERHOST:-\u@\h}"

View File

@ -1,5 +1,5 @@
Name: shell-color-prompt
Version: 0.4
Version: 0.4.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
* Thu Jan 25 2024 Jens Petersen <petersen@redhat.com> - 0.4.1-1
- also enable for Linux console (TERM=linux)
* Mon Nov 13 2023 Jens Petersen <petersen@redhat.com> - 0.4-1
- define PROMPT_COLOR
- add PROMPT_USERHOST default variable