From b96eb5ca34900c23bdafb1d1f6b51ef7f2184d5e Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Sun, 5 Jun 2022 03:12:22 -0400 Subject: [PATCH] User name colour prompt updated. --- tcshrc.prompt.colors | 3 +-- tcshrc.prompt.defs | 2 +- tcshrc.prompt.final | 12 ++++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tcshrc.prompt.colors b/tcshrc.prompt.colors index 866a8ee..bf159e7 100644 --- a/tcshrc.prompt.colors +++ b/tcshrc.prompt.colors @@ -9,7 +9,7 @@ set text_color="reset" set oldp_color="${dim}" set brace_color="ansi:11" set host_color="ansi:12" -set name_color="${bright_cyan}" +set user_color="ansi:14" set at_color="${dim_cyan}" set path_color="ansi:10" set line_color="${dim_red}" @@ -21,7 +21,6 @@ set color_start="%{" set color_end="%}" set oldp_color_seq="${color_start}${oldp_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}" set prompt_color_seq="${color_start}${prompt_color}${color_end}" diff --git a/tcshrc.prompt.defs b/tcshrc.prompt.defs index 48edb9b..452d8dd 100644 --- a/tcshrc.prompt.defs +++ b/tcshrc.prompt.defs @@ -126,7 +126,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 user_prompt="%n" 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 9bfbd43..a5154a9 100644 --- a/tcshrc.prompt.final +++ b/tcshrc.prompt.final @@ -53,6 +53,14 @@ if( "${curr_brace_color}" != "${brace_color}" ) then set brace_color_seq="%{[`__build_sgr_code no-csi reset ${curr_brace_color}`m%}" endif +if( ! $?curr_user_color ) then + set curr_user_color=impossible +endif +if( "${curr_user_color}" != "${user_color}" ) then + set curr_user_color="${user_color}" + set user_color_seq="%{[`__build_sgr_code no-csi reset ${curr_user_color}`m%}" +endif + if( ${prompt_hcolor} != 0 ) then set last_color = ${reference_colors[${prompt_hcolor}]} @@ -199,7 +207,7 @@ endif set prompt_reference_view="" set line_prompt_view="" set depth_prompt_view="" -set user_prompt_view +set user_prompt_view="" set at_view="" set host_prompt_view="" set git_prompt_view="" @@ -226,7 +234,7 @@ if( ! $?CSHENV_DISABLE_PROMPT_NESTING ) then endif endif if( ! $?CSHENV_DISABLE_PROMPT_USER ) then - set user_prompt_view="${user_prompt}" + set user_prompt_view="${user_color_seq}${user_prompt}%{${sgr_reset}%}" if( ! $?CSHENV_DISABLE_PROMPT_HOST ) then set at_view="${at_color_seq}@" endif