Fix prompt shuffling when shuf
is not found.
This commit is contained in:
@ -6,6 +6,11 @@ if( $?CSHENV_DEBUG ) then
|
|||||||
echo "Sourcing prompt setup and definitions..."
|
echo "Sourcing prompt setup and definitions..."
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
which shuf >& /dev/null
|
||||||
|
if( $? == 0 ) then
|
||||||
|
setenv CSHENV_DETECTED_SHUF
|
||||||
|
endif
|
||||||
|
|
||||||
if( ! $?unknown_tty ) then
|
if( ! $?unknown_tty ) then
|
||||||
set unknown_tty="?"
|
set unknown_tty="?"
|
||||||
if( $?CSHENV_DEBUG ) then
|
if( $?CSHENV_DEBUG ) then
|
||||||
|
@ -16,7 +16,13 @@ if( ${prompt_hcolor} == 0 ) then
|
|||||||
#echo colorshuffle
|
#echo colorshuffle
|
||||||
#endif
|
#endif
|
||||||
#echo
|
#echo
|
||||||
set reference_colors=`shuf -e $reference_colors`
|
# Shuffle, if supported
|
||||||
|
if( $?CSHENV_DETECTED_SHUF ) then
|
||||||
|
set reference_colors=`shuf -e $reference_colors`
|
||||||
|
else
|
||||||
|
#echo "FALLBACK COLOR!"
|
||||||
|
set reference_colors=`echo $reference_colors | sed -e 's/ /\n/' | sort -R | xargs`
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
@ -25,8 +31,13 @@ if( ${prompt_hsym} == 0 ) then # && ${prompt_hcolor} == 0 ) then
|
|||||||
echo symbolshuffle
|
echo symbolshuffle
|
||||||
endif
|
endif
|
||||||
#echo
|
#echo
|
||||||
set referencechars=`shuf -e $referencechars`
|
if( $?CSHENV_DETECTED_SHUF ) then
|
||||||
#set reference_colors=`shuf -e $reference_colors`
|
set referencechars=`shuf -e $referencechars`
|
||||||
|
#set reference_colors=`shuf -e $reference_colors`
|
||||||
|
else
|
||||||
|
#echo "FALLBACK CHAR!"
|
||||||
|
set referencechars=`echo $referencechars | sed -e 's/ /\n/' | sort -R | xargs`
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ prompt_hcolor = ${prompt_hcolor} + 1
|
@ prompt_hcolor = ${prompt_hcolor} + 1
|
||||||
|
Reference in New Issue
Block a user