Added a whole dynamic prompt tuning command
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
set prompt_elements="time date user host line git battery nesting path tty sigil"
|
||||
|
||||
if ( "" == "${1}" ) then
|
||||
echo "ERROR: prompt change with no parameters"
|
||||
endif
|
||||
|
||||
while ( "" != "${1}" )
|
||||
switch ( ${1} )
|
||||
case 'enable':
|
||||
shift
|
||||
if( $?CSHENV_DEBUG ) then
|
||||
echo unsetenv CSHENV_DISABLE_PROMPT_`echo ${1} | tr '[[:lower:]]' '[[:upper:]]'`
|
||||
endif
|
||||
eval unsetenv CSHENV_DISABLE_PROMPT_`echo ${1} | tr '[[:lower:]]' '[[:upper:]]'`
|
||||
breaksw
|
||||
|
||||
case 'disable':
|
||||
shift
|
||||
if( $?CSHENV_DEBUG ) then
|
||||
echo setenv CSHENV_DISABLE_PROMPT_`echo ${1} | tr '[[:lower:]]' '[[:upper:]]'`
|
||||
endif
|
||||
eval setenv CSHENV_DISABLE_PROMPT_`echo ${1} | tr '[[:lower:]]' '[[:upper:]]'`
|
||||
breaksw
|
||||
|
||||
case 'full':
|
||||
foreach element ( ${prompt_elements} )
|
||||
prompt enable ${element}
|
||||
end
|
||||
breaksw
|
||||
|
||||
case 'nothing':
|
||||
foreach element ( ${prompt_elements} )
|
||||
prompt disable ${element}
|
||||
end
|
||||
breaksw
|
||||
|
||||
case 'monochrome':
|
||||
source ${CSHENV_DIR}/tcshrc.prompt.clear_colors
|
||||
breaksw
|
||||
|
||||
case 'colors':
|
||||
source ${CSHENV_DIR}/tcshrc.prompt.colors
|
||||
breaksw
|
||||
|
||||
default:
|
||||
echo 'ERROR: Prompt setting command requires either `enable` or `disable`, you passed `'${1}'`'
|
||||
breaksw
|
||||
endsw
|
||||
shift
|
||||
end
|
||||
|
||||
|
||||
# vim: ft=tcsh
|
||||
Reference in New Issue
Block a user