From 8b398af6727aa7bdb78d3566f54774fb9df5f87f Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Sat, 4 Jun 2022 15:13:28 -0400 Subject: [PATCH] Did rework for `text_color` variable. --- tcshrc.prompt.colors | 3 +-- tcshrc.prompt.final | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/tcshrc.prompt.colors b/tcshrc.prompt.colors index ad66e21..1e27e5c 100644 --- a/tcshrc.prompt.colors +++ b/tcshrc.prompt.colors @@ -5,7 +5,7 @@ set date_color="ansi:5" set time_color="ansi:13" -set text_color="${bright_white}" +set text_color="reset" set oldp_color="${dim}" set brace_color="${bright_yellow}" set host_color="${bright_blue}" @@ -20,7 +20,6 @@ set command_color="${dim}" set color_start="%{" set color_end="%}" -set text_color_seq="${color_start}${text_color}${color_end}" set oldp_color_seq="${color_start}${oldp_color}${color_end}" set brace_color_seq="${color_start}${brace_color}${color_end}" set host_color_seq="${color_start}${host_color}${color_end}" diff --git a/tcshrc.prompt.final b/tcshrc.prompt.final index 33cae13..7c7bbe4 100644 --- a/tcshrc.prompt.final +++ b/tcshrc.prompt.final @@ -6,15 +6,15 @@ if( ! $?curr_path_color ) then set curr_path_color=impossible endif -if( ! $?curr_path_color || "${curr_path_color}" != "${path_color}" ) then +if( "${curr_path_color}" != "${path_color}" ) then set curr_path_color="${path_color}" - set path_color_seq="[`__build_sgr_code no-csi reset ${curr_path_color}`m" + set path_color_seq="%{[`__build_sgr_code no-csi reset ${curr_path_color}`m%}" endif if( ! $?curr_date_color ) then set curr_date_color=impossible endif -if( ! $?curr_date_color || "${curr_date_color}" != "${date_color}" ) then +if( "${curr_date_color}" != "${date_color}" ) then set curr_date_color="${date_color}" set date_color_seq="[`__build_sgr_code no-csi reset ${curr_date_color}`m" set date_prompt_view="%{${date_color_seq}%}${date_prompt}%{${sgr_reset}%}" @@ -23,12 +23,20 @@ endif if( ! $?curr_time_color ) then set curr_time_color=impossible endif -if( ! $?curr_time_color || "${curr_time_color}" != "${time_color}" ) then +if( "${curr_time_color}" != "${time_color}" ) then set curr_time_color="${time_color}" set time_color_seq="[`__build_sgr_code no-csi reset ${curr_time_color}`m" set time_prompt_view="%{${time_color_seq}%}${time_prompt}%{${sgr_reset}%}" endif +if( ! $?curr_text_color ) then + set curr_text_color=impossible +endif +if( "${curr_text_color}" != "${text_color}" ) then + set curr_text_color="${text_color}" + set text_color_seq="[`__build_sgr_code no-csi reset ${curr_text_color}`m" +endif + if( ${prompt_hcolor} != 0 ) then set last_color = ${reference_colors[${prompt_hcolor}]} endif @@ -186,7 +194,7 @@ if( ! $?CSHENV_DISABLE_PROMPT_SIGIL ) then endif if( ! $?CSHENV_DISABLE_PROMPT_TTY ) then set line_prompt_view="${line_prompt}" - set line_spacer_view="${text_color_seq}\- " + set line_spacer_view="%{${text_color_seq}%}\- " endif if( ! $?CSHENV_DISABLE_PROMPT_NESTING ) then set depth_prompt_spacing="" @@ -211,7 +219,7 @@ if( ! $?CSHENV_DISABLE_PROMPT_HOST ) then if( $?CSHENV_DISABLE_PROMPT_GIT && $?CSHENV_DISABLE_PROMPT_PATH ) then set host_prompt_tail="" endif - set host_prompt_view="${host_prompt}${text_color_seq}${host_prompt_tail}" + set host_prompt_view="${host_prompt}%{${text_color_seq}%}${host_prompt_tail}" endif if( ! $?CSHENV_DISABLE_PROMPT_GIT ) then set git_prompt_view="${git_prompt}" @@ -220,7 +228,7 @@ if( ! $?CSHENV_DISABLE_PROMPT_PATH ) then set path_prompt_view="%{${path_color_seq}%}${path_prompt}%{${sgr_reset}%}" endif -set prompt_cool="%{\n%}${align_prefix}${battery_prefix}${battery_prompt}${date_prompt_view}%{ %}${time_prompt_view}${align_suffix}${brace_color_seq}\[${prompt_reference_view}${line_prompt_view}${depth_prompt_view}${line_spacer_view}${user_prompt_view}${at_view}${host_prompt_view}${git_prompt_view}${path_prompt_view}${brace_color_seq}\]${end_prompt}" +set prompt_cool="%{\n%}${align_prefix}${battery_prefix}${battery_prompt}${date_prompt_view}%{ %}${time_prompt_view}${align_suffix}${brace_color_seq}\[${prompt_reference_view}${line_prompt_view}${depth_prompt_view}${line_spacer_view}${user_prompt_view}${at_view}${host_prompt_view}${git_prompt_view}${path_prompt_view}${brace_color_seq}\]${end_prompt}%{${text_color_seq}%}"