reset color definitions before loading a new theme

This commit is contained in:
fatalerrors
2026-04-15 15:16:11 +02:00
parent 1b16878ea8
commit dfad345be3
2 changed files with 76 additions and 68 deletions

View File

@@ -36,6 +36,8 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Color definitions # Color definitions
set_colors()
{
# Standard 16 colors display declaration # Standard 16 colors display declaration
export DEFAULTFG='\e[0;39m' export DEFAULTFG='\e[0;39m'
export DEFAULTBG='\e[0;49m' export DEFAULTBG='\e[0;49m'
@@ -111,6 +113,8 @@ export On_IBlue='\e[0;104m'
export On_IPurple='\e[0;105m' export On_IPurple='\e[0;105m'
export On_ICyan='\e[0;106m' export On_ICyan='\e[0;106m'
export On_IWhite='\e[0;107m' export On_IWhite='\e[0;107m'
}
export -f set_colors
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@@ -179,5 +183,6 @@ export -f disp
# Load disp section variables # Load disp section variables
load_conf disp load_conf disp
set_colors
# EOF # EOF

View File

@@ -198,6 +198,9 @@ set_theme()
# -- apply mode ---------------------------------------------------------- # -- apply mode ----------------------------------------------------------
local theme_name="$1" local theme_name="$1"
# Reset colours to defaults before loading the new theme
set_colors
load_theme "$theme_name" || return 1 load_theme "$theme_name" || return 1
export PROMPT_THEME="$theme_name" export PROMPT_THEME="$theme_name"