Files
cshenv/tcshrc.prompt.command

54 lines
1.2 KiB
Bash

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