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
+27 -22
View File
@@ -62,45 +62,50 @@ _debug "Done with color cacheing loop"
_debug "Dynamic color loading processed..."
while( ${#reference_colors} == 0 )
if( ${#reference_colors} == 0 ) then
_debug colorshuffle
#echo 
# Shuffle, if supported
if( $?cshenv_detected_shuf ) then
_debug "PRIMARY COLOR!"
set reference_colors=`shuf -e $reference_colors_original`
else
#echo "FALLBACK COLOR!"
_debug "FALLBACK COLOR!"
set reference_colors=`echo $reference_colors_original | tr " " "\n" | sort -R | xargs`
endif
if( ! $?last_color ) then
break
endif
set first_color = ${reference_colors[1]}
if( ${first_color} == ${last_color} ) then
set reference_colors=()
continue
endif
end
if( $?last_color ) then
set first_color = ${reference_colors[1]}
if( ${first_color} == ${last_color} ) then
_debug "COLLISION COLOR!"
# 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
endif
while( ${#referencechars} == 0 )
if( ${#referencechars} == 0 ) then
_debug symbolshuffle
#echo 
if( $?cshenv_detected_shuf ) then
_debug "PRIMARY CHAR!"
set referencechars=`shuf -e $referencechars_original`
else
#echo "FALLBACK CHAR!"
_debug "FALLBACK CHAR!"
set referencechars=(`echo $referencechars_original | tr " " "\n" | sort -R | xargs`)
endif
if( ! $?last_sym ) then
break
endif
set first_sym = ${referencechars[1]}
if( ${first_sym} == ${last_sym} ) then
set referencechars=()
continue
endif
end
if( $?last_sym ) then
set first_sym = ${referencechars[1]}
if( ${first_sym} == ${last_sym} ) then
_debug "COLLISION CHAR!"
set tmp_char="${referencechars[1]}"
shift referencechars
set referencechars=( ${referencechars} ${tmp_char} )
endif
endif
endif
if( $?CSHENV_DEBUG ) then
_debug ${reference_colors[1]} ${referencechars[1]}