tcsh: change color if last exit code != 0
parent
ce68ece5bc
commit
09c82d0ae8
|
@ -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} "
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue