Colour for nesting depth prompt is now modernized

This commit is contained in:
2022-06-05 15:37:08 -04:00
parent e9fe40ca91
commit 00338131e5
3 changed files with 11 additions and 4 deletions

View File

@ -13,13 +13,12 @@ set at_color="${dim_cyan}"
set path_color="ansi:10" set path_color="ansi:10"
set line_color="ansi:1" set line_color="ansi:1"
set prompt_color="reset" set prompt_color="reset"
set depth_color="${dim_yellow}" set depth_color="ansi:3"
set color_start="%{" set color_start="%{"
set color_end="%}" set color_end="%}"
set at_color_seq="${color_start}${at_color}${color_end}" set at_color_seq="${color_start}${at_color}${color_end}"
set depth_color_seq="${color_start}${depth_color}${color_end}"
########################### ###########################
# vim:filetype=tcsh # vim:filetype=tcsh

View File

@ -122,7 +122,7 @@ if( $?CSHENV_DEBUG ) then
endif endif
set depth_prompt="${depth_color_seq}(${shlvl})" set depth_prompt="(${shlvl})"
#we "convert" pts/$number entries to ttypK entries? #we "convert" pts/$number entries to ttypK entries?
set line_prompt="`tty | sed -e 's;/dev/tty;;' -e 's;/dev/pts/;p/;' -e 's;/dev/;;' -e 's/not a tty/${unknown_tty}/'`" set line_prompt="`tty | sed -e 's;/dev/tty;;' -e 's;/dev/pts/;p/;' -e 's;/dev/;;' -e 's/not a tty/${unknown_tty}/'`"

View File

@ -7,6 +7,14 @@ if( $?CSHENV_DEBUG ) then
endif endif
# Recompute cached sgr codes from any configuration updates # Recompute cached sgr codes from any configuration updates
if( ! $?curr_depth_color ) then
set curr_depth_color=impossible
endif
if( "${curr_depth_color}" != "${depth_color}" ) then
set curr_depth_color="${depth_color}"
set depth_color_seq="%{[`__build_sgr_code no-csi reset ${curr_depth_color}`m%}"
endif
if( ! $?curr_line_color ) then if( ! $?curr_line_color ) then
set curr_line_color=impossible set curr_line_color=impossible
endif endif
@ -248,7 +256,7 @@ if( ! $?CSHENV_DISABLE_PROMPT_NESTING ) then
if( ! $?CSHENV_DISABLE_PROMPT_TTY ) then if( ! $?CSHENV_DISABLE_PROMPT_TTY ) then
set depth_prompt_spacing=" " set depth_prompt_spacing=" "
endif endif
set depth_prompt_view="${depth_prompt_spacing}${depth_prompt}" set depth_prompt_view="${depth_color_seq}${depth_prompt_spacing}${depth_prompt}"
if( $?CSHENV_HIDE_SHELL_LEVEL_AT_ONE ) then if( $?CSHENV_HIDE_SHELL_LEVEL_AT_ONE ) then
if( ${shlvl} == 1 ) then if( ${shlvl} == 1 ) then
set depth_prompt_view="" set depth_prompt_view=""