Prompt sigil update uses shift, instead of math

This commit is contained in:
2026-07-08 00:30:16 -04:00
parent 53740b4a2c
commit 93153525e8
+21 -16
View File
@@ -62,45 +62,50 @@ _debug "Done with color cacheing loop"
_debug "Dynamic color loading processed..." _debug "Dynamic color loading processed..."
while( ${#reference_colors} == 0 ) if( ${#reference_colors} == 0 ) then
_debug colorshuffle _debug colorshuffle
#echo  #echo 
# Shuffle, if supported # Shuffle, if supported
if( $?cshenv_detected_shuf ) then if( $?cshenv_detected_shuf ) then
_debug "PRIMARY COLOR!"
set reference_colors=`shuf -e $reference_colors_original` set reference_colors=`shuf -e $reference_colors_original`
else else
#echo "FALLBACK COLOR!" _debug "FALLBACK COLOR!"
set reference_colors=`echo $reference_colors_original | tr " " "\n" | sort -R | xargs` set reference_colors=`echo $reference_colors_original | tr " " "\n" | sort -R | xargs`
endif endif
if( ! $?last_color ) then if( $?last_color ) then
break
endif
set first_color = ${reference_colors[1]} set first_color = ${reference_colors[1]}
if( ${first_color} == ${last_color} ) then if( ${first_color} == ${last_color} ) then
set reference_colors=() _debug "COLLISION COLOR!"
continue # Instead of a reshuffle, we put the collision at the end.
set tmp_color="${reference_colors[1]}"
shift reference_colors
set reference_colors=( ${reference_colors} ${tmp_color} )
endif endif
end endif
endif
while( ${#referencechars} == 0 ) if( ${#referencechars} == 0 ) then
_debug symbolshuffle _debug symbolshuffle
#echo  #echo 
if( $?cshenv_detected_shuf ) then if( $?cshenv_detected_shuf ) then
_debug "PRIMARY CHAR!"
set referencechars=`shuf -e $referencechars_original` set referencechars=`shuf -e $referencechars_original`
else else
#echo "FALLBACK CHAR!" _debug "FALLBACK CHAR!"
set referencechars=(`echo $referencechars_original | tr " " "\n" | sort -R | xargs`) set referencechars=(`echo $referencechars_original | tr " " "\n" | sort -R | xargs`)
endif endif
if( ! $?last_sym ) then if( $?last_sym ) then
break
endif
set first_sym = ${referencechars[1]} set first_sym = ${referencechars[1]}
if( ${first_sym} == ${last_sym} ) then if( ${first_sym} == ${last_sym} ) then
set referencechars=() _debug "COLLISION CHAR!"
continue set tmp_char="${referencechars[1]}"
shift referencechars
set referencechars=( ${referencechars} ${tmp_char} )
endif endif
end endif
endif
if( $?CSHENV_DEBUG ) then if( $?CSHENV_DEBUG ) then
_debug ${reference_colors[1]} ${referencechars[1]} _debug ${reference_colors[1]} ${referencechars[1]}