diff --git a/tcsh/.precmd.tcsh b/tcsh/.precmd.tcsh new file mode 100644 index 0000000..94e693d --- /dev/null +++ b/tcsh/.precmd.tcsh @@ -0,0 +1,3 @@ +set __prompt_key_color="${__host_color}" +if (! $__last_code == 0) set __prompt_key_color="%{\033[38;2;231;130;132m%}" +set prompt="${__host_color}%n@%m ${__git_color}`__git_current_branch`${__path_color}%~ ${__prompt_key_color}${__prompt_key}${__reset_color}${__reset_cursor} " diff --git a/tcsh/.tcshrc b/tcsh/.tcshrc index 0c36e6c..a69c967 100644 --- a/tcsh/.tcshrc +++ b/tcsh/.tcshrc @@ -8,10 +8,9 @@ if ($?prompt) then set __host_color="%{\033[38;2;140;170;238m%}" set __git_color="%{\033[38;2;131;139;167m%}" set __path_color="%{\033[38;2;202;158;230m%}" - set __prompt_key_color="${__host_color}" set __reset_color="%{\033[0m%}" - alias precmd 'set prompt="${__host_color}%n@%m ${__git_color}`__git_current_branch`${__path_color}%~ ${__prompt_key_color}${__prompt_key}${__reset_color}${__reset_cursor} "' + alias precmd 'set __last_code=$?; source ~/.precmd.tcsh' endif alias l "ls -lah"