From 286e9117f14e4d741d89518f5423bb7fa1bbffe3 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Sat, 4 Jun 2022 19:30:34 -0400 Subject: [PATCH] Host colour rewritten. --- tcshrc.prompt.colors | 3 +-- tcshrc.prompt.defs | 2 +- tcshrc.prompt.final | 10 +++++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tcshrc.prompt.colors b/tcshrc.prompt.colors index 1e27e5c..1a808c1 100644 --- a/tcshrc.prompt.colors +++ b/tcshrc.prompt.colors @@ -8,7 +8,7 @@ set time_color="ansi:13" set text_color="reset" set oldp_color="${dim}" set brace_color="${bright_yellow}" -set host_color="${bright_blue}" +set host_color="ansi:12" set name_color="${bright_cyan}" set at_color="${dim_cyan}" set path_color="ansi:10" @@ -22,7 +22,6 @@ set 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}" set name_color_seq="${color_start}${name_color}${color_end}" set at_color_seq="${color_start}${at_color}${color_end}" set line_color_seq="${color_start}${line_color}${color_end}" diff --git a/tcshrc.prompt.defs b/tcshrc.prompt.defs index 6b038fa..48edb9b 100644 --- a/tcshrc.prompt.defs +++ b/tcshrc.prompt.defs @@ -127,7 +127,7 @@ set depth_prompt="${depth_color_seq}(${shlvl})" #we "convert" pts/$number entries to ttypK entries? set line_prompt="${line_color_seq}`tty | sed -e 's;/dev/tty;;' -e 's;/dev/pts/;p/;' -e 's;/dev/;;' -e 's/not a tty/${unknown_tty}/'`" set user_prompt="${name_color_seq}%n" -set host_prompt="${host_color_seq}${CSHENV_HOSTNAME}" +set host_prompt="${CSHENV_HOSTNAME}" set path_prompt="%c02" set end_prompt="${prompt_color_seq}%#${command_color_seq} " diff --git a/tcshrc.prompt.final b/tcshrc.prompt.final index 7c7bbe4..0cecb6d 100644 --- a/tcshrc.prompt.final +++ b/tcshrc.prompt.final @@ -11,6 +11,14 @@ if( "${curr_path_color}" != "${path_color}" ) then set path_color_seq="%{[`__build_sgr_code no-csi reset ${curr_path_color}`m%}" endif +if( ! $?curr_host_color ) then + set curr_host_color=impossible +endif +if( "${curr_host_color}" != "${host_color}" ) then + set curr_host_color="${host_color}" + set host_color_seq="%{[`__build_sgr_code no-csi reset ${curr_host_color}`m%}" +endif + if( ! $?curr_date_color ) then set curr_date_color=impossible endif @@ -219,7 +227,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_color_seq}${host_prompt}%{${text_color_seq}%}${host_prompt_tail}" endif if( ! $?CSHENV_DISABLE_PROMPT_GIT ) then set git_prompt_view="${git_prompt}"