From cab9f98ef9b4d068975e149115695a80605c1651 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Fri, 19 Jun 2026 16:41:24 -0400 Subject: [PATCH 01/13] No need to hardcode this anymore. --- tcshrc.prompt.final | 2 -- 1 file changed, 2 deletions(-) diff --git a/tcshrc.prompt.final b/tcshrc.prompt.final index b6e674b..0d6a204 100644 --- a/tcshrc.prompt.final +++ b/tcshrc.prompt.final @@ -233,8 +233,6 @@ if( $?CSHENV_SHOW_BATTERY_LEVEL ) then set battery_level=`pmset -g batt | grep -Eo "\d+%" | cut -d% -f1` else if( $?CSHENV_BATTERY_DEVICE ) then set battery_level=`cat ${CSHENV_BATTERY_DEVICE}` - else - set battery_level=`cat /sys/class/power_supply/BAT1/capacity` endif if( ${battery_level} < ${critical_battery_level} ) then set battery_color=${red}${blink} From 8db7a5a13ec9e57c8b99210326249dd598885ea7 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Mon, 22 Jun 2026 09:47:14 -0400 Subject: [PATCH 02/13] Overhaul the installation and detection mechanisms --- startup_hooks/install.sh | 104 ++++++++++++++++++++++++--------------- startup_hooks/tcshrc | 37 ++++++++------ tcshrc.aliases | 2 +- 3 files changed, 89 insertions(+), 54 deletions(-) diff --git a/startup_hooks/install.sh b/startup_hooks/install.sh index af97d3c..96eafb6 100755 --- a/startup_hooks/install.sh +++ b/startup_hooks/install.sh @@ -3,47 +3,73 @@ # Yeah, my CSHENV Install script is written in Bourne shell. This is because # CSH isn't a great scripting language, but it is a nice interactive shell. -export REALPATH=`realpath $0` -export INSTALLER_LOCATION=`dirname ${REALPATH}` -export CSHENV_LOCATION=`dirname ${INSTALLER_LOCATION}` -export RELATIVE_CSHENV_LOCATION=`realpath --relative-to=${HOME} ${CSHENV_LOCATION}` +export HOMEPATH="$(realpath ~)" +export REALPATH=$(realpath ${0}) +export INSTALLER_LOCATION_REAL=$(dirname ${REALPATH}) +export INSTALLER_LOCATION=$(echo ${INSTALLER_LOCATION_REAL} | sed -e 's,'"${HOMEPATH}"',~,') +export CSHENV_LOCATION_REAL=$(dirname ${INSTALLER_LOCATION_REAL}) +export CSHENV_LOCATION=$(echo ${CSHENV_LOCATION_REAL} | sed -e 's,'"${HOMEPATH}"',~,') +export RELATIVE_CSHENV_LOCATION=$(echo ${CSHENV_LOCATION} | sed -e 's,~/,,') + +export TMP_BASE=$(realpath ~/.cshenv/installer-backup/) +mkdir -p ${TMP_BASE} +#mkdir -p ${TMP_BASE} +export __TMP=$(mktemp -dp ${TMP_BASE}) + +backup_config_file() +{ + __file="${1}" + mkdir -p ${__TMP}/ssh + + echo "Checking for ${__file}" + if [ -e ${__file} ] + then + case ${__file} in + *ssh/config) + echo "Backing up ${__file} to ${__TMP}/ssh" + mv ${__file} ${__TMP}/ssh/$(basename ${__file} | sed -e's/\.//') + ;; + *) + echo "Backing up ${__file} to ${__TMP}" + mv ${__file} ${__TMP}/$(basename ${__file} | sed -e's/\.//') + ;; + esac + else + echo "${__file} does not exist, not backing up anything." + fi +} + +install_shell_file() +{ + __file="${1}" + + backup_config_file ${1} + + echo "Installing ${1}" + echo "source ${CSHENV_LOCATION}/startup_hooks/$(basename ${1} | sed -e's/\.//') "'!#:1' > ${1} +} if [ -v CSHENV_DEBUG_INSTALLER ] then + echo HOMEPATH: $HOMEPATH + echo REALPATH: $REALPATH + echo TMP_BASE: $TMP_BASE + echo __TMP: $__TMP + echo INSTALLER_LOCATION_REAL: $INSTALLER_LOCATION_REAL + echo INSTALLER_LOCATION: $INSTALLER_LOCATION + echo CSHENV_LOCATION: $CSHENV_LOCATION + echo RELATIVE_CSHENV_LOCATION: $RELATIVE_CSHENV_LOCATION echo $CSHENV_LOCATION echo $RELATIVE_CSHENV_LOCATION exit fi -echo "Checking for ~/.login" -if [ ! -e ~/.login ] -then - echo "Installing ~/.login" - echo "setenv CSHENV_DIR ${CSHENV_LOCATION}" >> ~/.login - echo 'source ${CSHENV_DIR}/startup_hooks/login' >> ~/.login -fi +install_shell_file ~/.login -echo "Checking for ~/.tcshrc" -if [ ! -e ~/.tcshrc ] -then - echo "Installing ~/.tcshrc" - echo "setenv CSHENV_DIR ${CSHENV_LOCATION}" >> ~/.tcshrc - echo "setenv CSHENV_HIDE_SHELL_LEVEL_AT_ONE" >> ~/.tcshrc - echo 'source ${CSHENV_DIR}/startup_hooks/tcshrc' >> ~/.tcshrc -fi +install_shell_file ~/.tcshrc -echo "Checking for vim setup" -if [ -e ~/.vimrc ] -then - echo "Relocating vimrc" - mv ~/.vimrc ~/.vim/vimrc.old -fi - -if [ -e ~/.vim ] -then - echo "Relocating vim setup" - mv ~/.vim ~/.vim.old -fi +backup_config_file ~/.vimrc +backup_config_file ~/.vim echo "Installing vim setup" pushd ~ >& /dev/null @@ -51,11 +77,7 @@ ln -s `echo ${RELATIVE_CSHENV_LOCATION}`/vim .vim ln -s .vim/vimrc .vimrc popd >& /dev/null -if [ -e ~/.gitconfig ] -then - echo "Relocating git setup" - mv ~/.gitconfig ~/.gitconfig-old -fi +backup_config_file ~/.gitconfig echo "Installing git configuration" @@ -73,6 +95,10 @@ echo "" >> ~/.gitconfig echo "[commit]" >> ~/.gitconfig echo " gpgSign = true" >> ~/.gitconfig -echo "Do not forget to add the following lines at the top and bottom of your ssh config:" -echo "Match all\n Include ${CSHENV_LOCATION}/ssh/config" -echo "Match all\n Include ${CSHENV_LOCATION}/ssh/config" +backup_config_file ~/.ssh/config + +echo "Match all" >> ~/.ssh/config +echo " Include ${CSHENV_LOCATION}/ssh/prologue" >> ~/.ssh/config + +echo "Match all" >> ~/.ssh/config +echo " Include ${CSHENV_LOCATION}/ssh/epilogue" >> ~/.ssh/config diff --git a/startup_hooks/tcshrc b/startup_hooks/tcshrc index 019e7cb..5e871f1 100644 --- a/startup_hooks/tcshrc +++ b/startup_hooks/tcshrc @@ -1,14 +1,33 @@ # This file will always be taken in. .login is now # vestigial, and doesn't matter if first or second. -# These are the bits that would be in login: - +# Reset the CSHENV_DIR +# (TODO: Downgrade this from environment variable to shell variable) +unsetenv CSHENV_DIR if( ! $?CSHENV_DIR ) then - setenv CSHENV_DIR ~/cshenv + if( $?CSHENV_DEBUG ) then + echo "CSHENV_DIR is not set. Guessing it based upon "'${1}'": ${1}" + endif + # Done twice to strip out the hooks dir and the hook itself. + setenv CSHENV_DIR ${1}_ + setenv CSHENV_DIR `dirname ${CSHENV_DIR}` + setenv CSHENV_DIR `dirname ${CSHENV_DIR}` + if( $?CSHENV_DEBUG ) then + echo "CSHENV_DIR is auto set to ${CSHENV_DIR}" + endif + + if( "." == $#CSHENV_DIR ) then + if( $?CSHENV_DEBUG ) then + echo "CSHENV_DIR is still not set. Using guessed default." + endif + + set cshenv_fallback_dir + setenv CSHENV_DIR ~/cshenv + endif endif if( $?CSHENV_DEBUG ) then - echo "Set CSHENV_DIR to: " ${CSHENV_DIR} + echo "Set (in tcshrc hook) CSHENV_DIR to: " ${CSHENV_DIR} endif setenv LC_NUMERIC en_US.UTF-8 @@ -25,16 +44,6 @@ if( $?CSHENV_DEBUG ) then echo "Starting tcshrc..." endif -#if( -z ${_} ) then - #echo $0 - #setenv CSHENV_TCSHRC_PATH $0 -#else - #echo ${_} - #setenv CSHENV_TCSHRC_PATH "${_}" -#endif - -#echo tcshrc hook lives at: ${CSHENV_TCSHRC_PATH} - if( -c `tty` ) then if( $?CSHENV_DEBUG ) then echo "Going to source core tcshrc..." diff --git a/tcshrc.aliases b/tcshrc.aliases index 0ae762e..5157827 100644 --- a/tcshrc.aliases +++ b/tcshrc.aliases @@ -1,6 +1,6 @@ # CSHENV Aliases: -alias resource source ${CSHENV_DIR}/startup_hooks/tcshrc +alias resource 'source ${CSHENV_DIR}/startup_hooks/tcshrc ${CSHENV_DIR}/startup_hooks/tcshrc' alias relog resource alias rl relog From 9ed5dfd09ba93736e9289b21f8fd2abc6091fbf2 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Mon, 22 Jun 2026 19:33:17 -0400 Subject: [PATCH 03/13] Convert color script to portable POSIX shell --- bin/__build_sgr_code | 291 +++++++++++++++++++++++-------------------- 1 file changed, 158 insertions(+), 133 deletions(-) diff --git a/bin/__build_sgr_code b/bin/__build_sgr_code index 0b025e9..29deac6 100755 --- a/bin/__build_sgr_code +++ b/bin/__build_sgr_code @@ -13,54 +13,74 @@ debug=0 +debug_print() +{ + if [ ${debug} -ne 0 ] + then + echo ${*} >&2 + fi +} + # This is the named color map. Just add new entries and they'll be supported... -declare -A map -map[white]="FFFFFF" -map[silver]="C0C0C0" -map[gray]="808080" -map[grey]="808080" -map[black]="000000" -map[red]="FF0000" -map[maroon]="800000" -map[yellow]="FFFF00" -map[olive]="808000" -map[lime]="00FF00" -map[green]="008000" -map[aqua]="00FFFF" -map[teal]="008080" -map[blue]="0000FF" -map[navy]="000080" -map[fuchsia]="FF00FF" -map[purple]="800080" +COLOR_TABLE="" + +map() +{ + if [ $# -eq 2 ] + then + COLOR_TABLE="${COLOR_TABLE}:${1}=${2}" + else + ___right="${COLOR_TABLE##*:${1}=}" + echo ${___right%%:*} + fi +} + +map white "FFFFFF" +map silver "C0C0C0" +map gray "808080" +map grey "808080" +map black "000000" +map red "FF0000" +map maroon "800000" +map yellow "FFFF00" +map olive "808000" +map lime "00FF00" +map green "008000" +map aqua "00FFFF" +map teal "008080" +map blue "0000FF" +map navy "000080" +map fuchsia "FF00FF" +map purple "800080" # Some VGA color names can be promoted: -map[brown]="aa5500" -map[cyan]="00aaaa" +map brown "aa5500" +map cyan "00aaaa" # The VGA names can be prefixed with "vga-" to explicitly avoid the collisions with HTML names, above... # Based upon wikipedia's article on ANSI. See the table on that page for details. -map[vga-black]="000000" -map[vga-red]="aa0000" -map[vga-green]="00aa00" -map[vga-brown]="aa5500" -map[vga-yellow]="aa5500" -map[vga-blue]="0000aa" -map[vga-magenta]="aa00aa" -map[vga-cyan]="00aaaa" -map[vga-white]="aaaaaa" +map vga-black "000000" +map vga-red "aa0000" +map vga-green "00aa00" +map vga-brown "aa5500" +map vga-yellow "aa5500" +map vga-blue "0000aa" +map vga-magenta "aa00aa" +map vga-cyan "00aaaa" +map vga-white "aaaaaa" -map[vga-brightblack]="555555" -map[vga-grey]="555555" -map[vga-gray]="555555" -map[vga-brightred]="ff5555" -map[vga-brightgreen]="55ff55" -map[vga-brightyellow]="ffff55" -map[vga-brightblue]="5555ff" -map[vga-brightmagenta]="ff55ff" -map[vga-brightcyan]="55ffff" -map[vga-brightwhite]="ffffff" +map vga-brightblack "555555" +map vga-grey "555555" +map vga-gray "555555" +map vga-brightred "ff5555" +map vga-brightgreen "55ff55" +map vga-brightyellow "ffff55" +map vga-brightblue "5555ff" +map vga-brightmagenta "ff55ff" +map vga-brightcyan "55ffff" +map vga-brightwhite "ffffff" enable_greyscale_cheat=0 @@ -71,10 +91,13 @@ then shift 1 fi -function dump_colors() +dump_colors() { - for key in ${!map[@]} + all_maps=$(echo ${COLOR_TABLE} | sed -e 's/:/ /g' -e 's/=[0-9a-fA-F]\{6\}//g') + debug_print "Going through all these colors ${all_maps} (${COLOR_TABLE})" + for key in ${all_maps} do + debug_print "Processing key ${key}" case $key in *bright*) text_color="000000" ;; *black*) text_color="ffffff" ;; @@ -100,7 +123,7 @@ function dump_colors() exit 0 } -function cube_row() +cube_row() { r_base=${1} g=0 @@ -135,7 +158,7 @@ function cube_row() printf '\n' } -function greyscale_chart() +greyscale_chart() { [ ${i} -ge 244 ] && txt=";30" @@ -148,7 +171,7 @@ function greyscale_chart() printf '\n' } -function color_chart() +color_chart() { i=0 @@ -171,22 +194,22 @@ function color_chart() greyscale_chart } -function setup_color_depth() +setup_color_depth() { use_8_bit=0 use_4_bit=0 use_3_bit=0 # Must only be set if terminal colors are reduced... - if [[ -v CSHENV_TERMINAL_COLORS ]] + if [ "${CSHENV_TERMINAL_COLORS+x}" ] then - if (( ${CSHENV_TERMINAL_COLORS} == 256 )) + if [ ${CSHENV_TERMINAL_COLORS} -eq 256 ] then use_8_bit=1 - elif (( ${CSHENV_TERMINAL_COLORS} == 16 )) + elif [ ${CSHENV_TERMINAL_COLORS} -eq 16 ] then use_4_bit=1 - elif (( ${CSHENV_TERMINAL_COLORS} == 8 )) + elif [ ${CSHENV_TERMINAL_COLORS} -eq 8 ] then use_3_bit=1 else @@ -195,23 +218,23 @@ function setup_color_depth() fi } -function render_color() +render_color() { command_color=30 - if (( ${use_3_bit} )) + if [ ${use_3_bit} -ne 0 ] then # Underline colours need 8-bit or more - if (( ${background} > 1 )) ; then return; fi + if [ ${background} -gt 1 ] ; then return; fi basecolor=$(( ${command_color} + ${background}*10)) next="$(( ${basecolor} + ${legacy_3_bit} ))" - elif (( ${use_4_bit} )) + elif [ ${use_4_bit} -ne 0 ] then # Underline colours need 8-bit or more - if (( ${background} > 1 )) ; then return; fi + if [ ${background} -gt 1 ] ; then return; fi command_color=$(( ${command_color} + ${intensity_1_bit} * 60 )) basecolor=$(( ${command_color} + ${background}*10 )) next="$(( ${basecolor} + ${legacy_3_bit} ))" - elif (( ${use_8_bit} )) + elif [ ${use_8_bit} -ne 0 ] then basecolor=$(( 8 + ${command_color} + ${background}*10 )) next="${basecolor};5;${ext_8_bit}" @@ -223,12 +246,12 @@ function render_color() -function ansi_color() +ansi_color() { - if (( ${1} > 15 )) + if [ ${1} -gt 15 ] then echo "ERROR!" 1>&2 ; exit -1 - elif (( ${1} >= 8 )) + elif [ ${1} -ge 8 ] then use_4_bit=1 intensity_1_bit=1 @@ -240,11 +263,11 @@ function ansi_color() fi } -function ext_grey() +ext_grey() { use_8_bit=1 grey_val=${1} - if (( ${grey_val} < 0 || ${grey_val} > 23 )) + if [ ${grey_val} -le 0 - ${grey_val} -gt 23 ] then echo "ERROR!" 1>&2 ; exit -1 fi @@ -260,10 +283,10 @@ function ext_rgb() ext_8_bit=$(( 16 + 36 * ${red_ext_val} + 6 * ${green_ext_val} + ${blue_ext_val} )) } -function ext_color() +ext_color() { use_8_bit=1 - if (( ${1} > 255 )) + if [ ${1} -gt 255 ] then echo "ERROR!" 1>&2 ; exit -1 else @@ -271,7 +294,7 @@ function ext_color() fi } -function rgb_color() +rgb_color() { color=$1 case $1 in @@ -287,11 +310,11 @@ function rgb_color() green_dec=$((16#${green_hex})) blue_dec=$((16#${blue_hex})) - if (( ${debug} != 0 )) - then - echo "Red: $red_dec" - echo "Green: $green_dec" - echo "Blue: $blue_dec" + if [ ${debug} -ne 0 ] + then + debug_print "Red: $red_dec" + debug_print "Green: $green_dec" + debug_print "Blue: $blue_dec" fi # Now compute the rest of the stuff... @@ -311,22 +334,22 @@ function rgb_color() # If we can support an intensity bit, we'll turn that on too... # But we're going to stop using bold to set the colour "intense" # We'll use the 9x and 10x forms... - if (( ${red_dec} >= 192 || ${green_dec} >= 192 || ${blue_dec} >= 192 )) + if [ ${red_dec} -ge 192 -o ${green_dec} -ge 192 -o ${blue_dec} -ge 192 ] then intensity_1_bit=1 fi - if (( ${debug} != 0 )) + if [ ${debug} -ne 0 ] then - echo "Red bit: " $red_1_bit - echo "Green bit: " $green_1_bit - echo "Blue bit: " $blue_1_bit - echo "Intensity bit: " $intensity_1_bit + debug_print "Red bit: " $red_1_bit + debug_print "Green bit: " $green_1_bit + debug_print "Blue bit: " $blue_1_bit + debug_print "Intensity bit: " $intensity_1_bit fi # Because grey is tricky, I'm going to special case it: - if (( 1 && ${red_dec} == ${green_dec} && ${green_dec} == ${blue_dec} && ${red_dec} < 128 && ${red_dec} >= 80 )) + if [ ${red_dec} -eq ${green_dec} -a ${green_dec} -eq ${blue_dec} -a ${red_dec} -lt 128 -a ${red_dec} -ge 80 ] then red_1_bit=0 green_1_bit=0 @@ -335,28 +358,28 @@ function rgb_color() fi # Because brown is tricky, I'm going to special case it: - if (( ${red_dec} > 128 && ${green_dec} > 80 && ${blue_dec} < 50 )) + if [ ${red_dec} -gt 128 -a ${green_dec} -gt 80 -a ${blue_dec} -lt 50 ] then red_1_bit=1 green_1_bit=1 blue_1_bit=0 fi - if (( ${debug} != 0 )) + if [ ${debug} -ne 0 ] then - echo "Red bit: " $red_1_bit - echo "Green bit: " $green_1_bit - echo "Blue bit: " $blue_1_bit - echo "Intensity bit: " $intensity_1_bit - fi + debug_print "Red bit: " $red_1_bit + debug_print "Green bit: " $green_1_bit + debug_print "Blue bit: " $blue_1_bit + debug_print "Intensity bit: " $intensity_1_bit + fi # This lets us combine them for a legacy colour value in the legacy colour space... legacy_3_bit=$(( ( ${blue_1_bit} << 2 ) + ( ${green_1_bit} << 1 ) + ( ${red_1_bit} ) )) - if (( ${debug} != 0 )) + if [ ${debug} -ne 0 ] then - echo "Legacy colour: " ${legacy_3_bit} " Intensity: " ${intensity_1_bit} + debug_print "Legacy colour: " ${legacy_3_bit} " Intensity: " ${intensity_1_bit} fi # Now compute an extended colour cube placement (216 colours): @@ -365,35 +388,35 @@ function rgb_color() green_ext_val=$(( ${green_dec} * 6 / 256 )) blue_ext_val=$(( ${blue_dec} * 6 / 256 )) - if (( ${debug} != 0 )) + if [ ${debug} -ne 0 ] then - echo "Red ext: " ${red_ext_val} - echo "Green ext: " ${green_ext_val} - echo "Blue ext: " ${blue_ext_val} + debug_print "Red ext: " ${red_ext_val} + debug_print "Green ext: " ${green_ext_val} + debug_print "Blue ext: " ${blue_ext_val} fi ext_8_bit=$(( 16 + 36 * ${red_ext_val} + 6 * ${green_ext_val} + ${blue_ext_val} )) - if (( ${debug} )) + if [ ${debug} -ne 0 ] then - echo "Computed 216 color cube: " ${ext_8_bit} + debug_print "Computed 216 color cube: " ${ext_8_bit} fi # Check for precise greyscale, which would replace the above: # (Note that precise greyscale is implied by a user explicitly making ALL of RGB the # same value, thus demanding greyscale, rather than a subtle tinting...) - if (( ${red_dec} == ${green_dec} && ${green_dec} == ${blue_dec} )) + if [ ${red_dec} -eq ${green_dec} -a ${green_dec} -eq ${blue_dec} ] then ext_8_bit=$(( 232 + ${red_dec} * 24 / 256 )) fi - if (( ${debug} )) + if [ ${debug} -ne 0 ] then - echo "Computed 256 color choice, after applying greyscale scan: " ${ext_8_bit} + debug_print "Computed 256 color choice, after applying greyscale scan: " ${ext_8_bit} fi - if (( ${enable_greyscale_cheat} )) + if [ ${enable_greyscale_cheat} -ne 0 ] then # Check for SPECIFIC white and black and grey: # The half-saturation, no saturation, and full saturation values are mapped @@ -403,34 +426,34 @@ function rgb_color() # points in the 6x6x6 colour cube.) # # TODO: Only map the head and tail of the colour cube. - if (( ${red_dec} == ${green_dec} && ${green_dec} == ${blue_dec} )) + if [ ${red_dec} -eq ${green_dec} -a ${green_dec} -eq ${blue_dec} ] then - if (( ${red_dec} == 0 )) + if [ ${red_dec} -eq 0 ] then ext_8_bit=0 - elif (( ${red_dec} == 255 )) + elif [ ${red_dec} -eq 255 ] then ext_8_bit=15 - elif (( ${red_dec} == 128 )) + elif [ ${red_dec} -eq 128 ] then ext_8_bit=8 - elif (( ${red_dec} == 192 )) + elif [ ${red_dec} -eq 192 ] then ext_8_bit=7 fi fi fi - if (( ${debug} )) + if [ ${debug} -ne 0 ] then - echo "Computed 256 color choice, after applying white and black scan: " ${ext_8_bit} + debug_print "Computed 256 color choice, after applying white and black scan: " ${ext_8_bit} fi # We do NOT check for the base colours precisely. Since those 16 can be custom mapped by your terminal emulator, you just pass `ansi:0` thru # `ansi:15` to select them by ID. Or use `ext:0` thru `ext:255` to select a specific extended colour. } -function make_color() +make_color() { setup_color_depth background=$1 # $1 is the background bit @@ -438,19 +461,20 @@ function make_color() render_color } -function named_color() +named_color() { - name=${1,,} - if [[ ! -v map[$name] ]] + name=$( echo ${1} | awk '{print tolower($1)}' ) + mapped=$(map ${name}) + debug_print "${name} -> ${mapped}" + if [ -z "${mapped}" ] then echo "ERROR!" 1>&2 ; exit -1 fi - mapped=${map[$name]} rgb_color ${mapped} } -function build_sgr_code() +build_sgr_code() { case $1 in dump-colors) dump_colors ;; @@ -469,41 +493,41 @@ function build_sgr_code() doubleunder) next=21 ;; reveal) next=28 ;; - ansi:*) make_color 0 ansi_color ${1:5} ;; - ext:grey*) make_color 0 ext_grey ${1:8} ;; - ext:rgb*) make_color 0 ext_rgb ${1:7} ;; - ext:*) make_color 0 ext_color ${1:4} ;; + ansi:*) make_color 0 ansi_color ${1#?????} ;; + ext:grey*) make_color 0 ext_grey ${1#????????} ;; + ext:rgb*) make_color 0 ext_rgb ${1#???????} ;; + ext:*) make_color 0 ext_color ${1#????} ;; # 12-bit color also supported [0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 0 rgb_color $1 ;; [0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 0 rgb_color $1 ;; - fg:ansi:*) make_color 0 ansi_color ${1:8} ;; - fg:ext:grey*) make_color 0 ext_grey ${1:11} ;; - fg:ext:rgb*) make_color 0 ext_rgb ${1:10} ;; - fg:ext:*) make_color 0 ext_color ${1:7} ;; + fg:ansi:*) make_color 0 ansi_color ${1#????????} ;; + fg:ext:grey*) make_color 0 ext_grey ${1#???????????} ;; + fg:ext:rgb*) make_color 0 ext_rgb ${1#??????????} ;; + fg:ext:*) make_color 0 ext_color ${1#???????} ;; # 12-bit color also supported - fg:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 0 rgb_color ${1:3} ;; - fg:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 0 rgb_color ${1:3} ;; + fg:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 0 rgb_color ${1:???} ;; + fg:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 0 rgb_color ${1:???} ;; - bg:ansi:*) make_color 1 ansi_color ${1:8} ;; - bg:ext:grey*) make_color 1 ext_grey ${1:11} ;; - bg:ext:rgb*) make_color 1 ext_rgb ${1:10} ;; - bg:ext:*) make_color 1 ext_color ${1:7} ;; + bg:ansi:*) make_color 1 ansi_color ${1#????????} ;; + bg:ext:grey*) make_color 1 ext_grey ${1#???????????} ;; + bg:ext:rgb*) make_color 1 ext_rgb ${1#??????????} ;; + bg:ext:*) make_color 1 ext_color ${1#???????} ;; # 12-bit color also supported - bg:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 1 rgb_color ${1:3} ;; - bg:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 1 rgb_color ${1:3} ;; + bg:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 1 rgb_color ${1#???} ;; + bg:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 1 rgb_color ${1#???} ;; - ul:ext:*) make_color 2 ext_color ${1:7} ;; + ul:ext:*) make_color 2 ext_color ${1#???????} ;; # 12-bit color also supported - ul:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 2 rgb_color ${1:3} ;; - ul:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 2 rgb_color ${1:3} ;; + ul:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 2 rgb_color ${1#???} ;; + ul:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 2 rgb_color ${1#???} ;; - fg:*) make_color 0 named_color ${1:3} ;; - bg:*) make_color 1 named_color ${1:3} ;; - ul:*) make_color 2 named_color ${1:3} ;; + fg:*) make_color 0 named_color ${1#???} ;; + bg:*) make_color 1 named_color ${1#???} ;; + ul:*) make_color 2 named_color ${1#???} ;; *) make_color 0 named_color $1 ;; esac - if [[ ! -z ${output} ]] + if [ ! -z ${output} ] then output="${output};" fi @@ -511,17 +535,18 @@ function build_sgr_code() } output="" -while [[ ! -z $1 ]] +while [ ! -z $1 ] do build_sgr_code $1 shift 1 done -if [[ ! -z ${output} ]] && (( ! ${nocsi} )) +if [ ! -z "${output}" ] && [ ${nocsi} -ne 1 ] then + #echo "I AM PRINTING WITH CSI! (${nocsi} is nocsi, \`${output}\` is output)">&2 output="[${output}m" fi -if [[ ! -z ${output} ]] +if [ ! -z "${output}" ] then printf ${output} fi From 222bdc69bca0401f542f167461a1fb11c97e79ec Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Tue, 23 Jun 2026 15:01:51 -0400 Subject: [PATCH 04/13] Hiding shell level at 1 is the default. --- tcshrc.prompt.final | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcshrc.prompt.final b/tcshrc.prompt.final index 0d6a204..8fb6315 100644 --- a/tcshrc.prompt.final +++ b/tcshrc.prompt.final @@ -345,7 +345,7 @@ if( ! $?CSHENV_DISABLE_PROMPT_NESTING ) then set depth_prompt_spacing=" " endif set depth_prompt_view="${depth_color_seq}${depth_prompt_spacing}${depth_prompt}" - if( $?CSHENV_HIDE_SHELL_LEVEL_AT_ONE ) then + if( $?CSHENV_SHOW_SHELL_LEVEL_AT_ONE ) then if( ${shlvl} == 1 ) then set depth_prompt_view="" endif From 265ed785dbff4be41ff9a70bd56761df413a1dc1 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Tue, 23 Jun 2026 21:13:03 -0400 Subject: [PATCH 05/13] Fix shell level hiding --- tcshrc.prompt.final | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcshrc.prompt.final b/tcshrc.prompt.final index 8fb6315..2bb063d 100644 --- a/tcshrc.prompt.final +++ b/tcshrc.prompt.final @@ -345,7 +345,7 @@ if( ! $?CSHENV_DISABLE_PROMPT_NESTING ) then set depth_prompt_spacing=" " endif set depth_prompt_view="${depth_color_seq}${depth_prompt_spacing}${depth_prompt}" - if( $?CSHENV_SHOW_SHELL_LEVEL_AT_ONE ) then + if( ! $?CSHENV_SHOW_SHELL_LEVEL_AT_ONE ) then if( ${shlvl} == 1 ) then set depth_prompt_view="" endif From 5d135454d940ed4d40eefc9211acbc7ea2a41c54 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Thu, 18 Jun 2026 20:29:51 -0400 Subject: [PATCH 06/13] Add `_debug` primitive --- startup_hooks/tcshrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/startup_hooks/tcshrc b/startup_hooks/tcshrc index 5e871f1..f3735c8 100644 --- a/startup_hooks/tcshrc +++ b/startup_hooks/tcshrc @@ -30,6 +30,8 @@ if( $?CSHENV_DEBUG ) then echo "Set (in tcshrc hook) CSHENV_DIR to: " ${CSHENV_DIR} endif +alias _debug 'eval "if ( $?CSHENV_DEBUG ) echo \!*"' + setenv LC_NUMERIC en_US.UTF-8 setenv LC_MEASUREMENT en_US.UTF-8 setenv LC_MONETARY en_US.UTF-8 From 03b27900fff75816b00899bf069d618ec561cc97 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Thu, 18 Jun 2026 20:33:29 -0400 Subject: [PATCH 07/13] Upgrade some debug printing to debug statements. --- startup_hooks/tcshrc | 12 +++--------- tcshrc | 6 ++---- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/startup_hooks/tcshrc b/startup_hooks/tcshrc index f3735c8..199c483 100644 --- a/startup_hooks/tcshrc +++ b/startup_hooks/tcshrc @@ -42,14 +42,10 @@ setenv LC_TIME en_US.UTF-8 set CSHENV_TCSHRC_SOURCED -if( $?CSHENV_DEBUG ) then - echo "Starting tcshrc..." -endif +_debug "Starting tcshrc..." if( -c `tty` ) then - if( $?CSHENV_DEBUG ) then - echo "Going to source core tcshrc..." - endif + _debug "Going to source core tcshrc..." # Capture the original path, so that we don't # keep infinitely expanding it. @@ -64,9 +60,7 @@ endif # Not using tcshrc bits for non-login shells. Will decide what to do later. -if( $?CSHENV_DEBUG ) then - echo "Ending tcshrc..." -endif +_debug "Ending tcshrc..." ########################### # vim: ft=tcsh diff --git a/tcshrc b/tcshrc index c5bc114..3de5a41 100644 --- a/tcshrc +++ b/tcshrc @@ -23,9 +23,7 @@ if( $?tcsh ) then echo "We are on a very ancient TCSH! There may be many problems..." else if( $tcsh_minor == 14 && $tcsh_patch < 2 ) then - if( $?CSHENV_DEBUG ) then - echo "We may not have ADAM's patches..." - endif + _debug "We may not have ADAM's patches..." endif endif @@ -54,7 +52,7 @@ if( $?CSHENV_HISTORY_SIZE ) then set history=${CSHENV_HISTORY_SIZE} endif -if( $?CSHENV_DEBUG ) echo "Setting up optional sourcing mechanism." +_debug "Setting up optional sourcing mechanism." # This safe_source alias is incredibly delicate. It drives the whole # optional sourcing mechanism -- DO NOT MESS WITH IT! alias safe_source 'eval "if ( -f \!:1 ) then \\ From ad69be9fe23dd388da1bd7eb1513ee19767c33a2 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Tue, 23 Jun 2026 17:00:49 -0400 Subject: [PATCH 08/13] More debug prints converted --- tcshrc | 42 +++++++++++++----------------------------- tcshrc.aliases | 16 ++++------------ tcshrc.prompt.defs | 8 ++------ 3 files changed, 19 insertions(+), 47 deletions(-) diff --git a/tcshrc b/tcshrc index 3de5a41..fb16b15 100644 --- a/tcshrc +++ b/tcshrc @@ -42,9 +42,7 @@ set noding set padhour -if( $?CSHENV_DEBUG ) then - echo "TCSH Featureset probed..." -endif +_debug "TCSH Featureset probed..." #The history size for your shell can be set globally now @@ -59,22 +57,20 @@ alias safe_source 'eval "if ( -f \!:1 ) then \\ source \!:1 \\ endif"' -if( $?CSHENV_DEBUG ) echo "Setting up optional session sourcing mechanism." +_debug "Setting up optional session sourcing mechanism." # These reload_session and `__load_session` aliases ar incredibly delicate. They drives # the whole optional session mechanism -- DO NOT MESS WITH IT LIGHTLY! alias __load_session safe_source tcshrc.session.\$CSHENV_SESSION_PROFILE -if( $?CSHENV_DEBUG ) echo "Setting up optional session sourcing mechanism wrapper." +_debug "Setting up optional session sourcing mechanism wrapper." alias reload_session 'eval "if ( \$?CSHENV_SESSION_PROFILE ) then \\ __load_session \\ endif"' -if( $?CSHENV_DEBUG ) echo "Setting change session alias..." +_debug "Setting change session alias..." alias change_session setenv CSHENV_SESSION_PROFILE \!:1\;__load_session -if( $?CSHENV_DEBUG ) then - echo "TCSH safe-source alias constructed..." -endif +_debug "TCSH safe-source alias constructed..." safe_source ${CSHENV_DIR}/tcshrc.conf @@ -83,9 +79,7 @@ safe_source ${CSHENV_DIR}/tcshrc.conf # This will figure out what system we're on and setup all # system specific notions. From the sourced file, # tcshrc.system.???? will be called -if( $?CSHENV_DEBUG ) then - echo "Trying to source tcshrc.system" -endif +_debug "Trying to source tcshrc.system" source ${CSHENV_DIR}/tcshrc.system #For GNU ls(1) {From coreutils} and tcsh's color ls-F @@ -99,30 +93,22 @@ endif setenv CLICOLOR_FORCE -if( $?CSHENV_DEBUG ) then - echo "Trying to source tcshrc.${CSHENV_SYSTEM}" -endif +_debug "Trying to source tcshrc.${CSHENV_SYSTEM}" safe_source ${CSHENV_DIR}/tcshrc.${CSHENV_SYSTEM} # Having figured out the system, then we can load specific aliases -if( $?CSHENV_DEBUG ) then - echo "Trying to source tcshrc.aliases" -endif +_debug "Trying to source tcshrc.aliases" source ${CSHENV_DIR}/tcshrc.aliases -if( $?CSHENV_DEBUG ) then - echo "Trying to source tcshrc.${CSHENV_HOSTNAME}" -endif +_debug "Trying to source tcshrc.${CSHENV_HOSTNAME}" safe_source ${CSHENV_DIR}/tcshrc.${CSHENV_HOSTNAME} if( $?CSHENV_ORGANIZATION ) then safe_source ${CSHENV_DIR}/tcshrc.${CSHENV_ORGANIZATION} endif -if( $?CSHENV_DEBUG ) then - echo "Trying to source tcshrc.bindkeys" -endif +_debug "Trying to source tcshrc.bindkeys" source ${CSHENV_DIR}/tcshrc.bindkeys set path=( ${path} /usr/sbin /sbin ) @@ -130,16 +116,14 @@ set path=( ${path} /usr/sbin /sbin ) # TCSHRC Prompt is the LAST thing we do, since it's the entry to # user interface -if( $?CSHENV_DEBUG ) then - echo "Trying to source tcshrc.prompt" -endif +_debug "Trying to source tcshrc.prompt" source ${CSHENV_DIR}/tcshrc.prompt safe_source ${CSHENV_DIR}/tcshrc.user -if( $?CSHENV_DEBUG ) echo "Loading session, if one is set" +_debug "Loading session, if one is set" reload_session -if( $?CSHENV_DEBUG ) echo "Session loading done" +_debug "Session loading done" ########################### diff --git a/tcshrc.aliases b/tcshrc.aliases index 5157827..fa9465f 100644 --- a/tcshrc.aliases +++ b/tcshrc.aliases @@ -19,9 +19,7 @@ if( ( $?CSHENV_DEBUG ) || ( $?CSHENV_VERBOSE_STARTUP ) ) then endif if( $?CSHENV_USE_GNU_LS ) then - if( $?CSHENV_DEBUG ) then - echo "Finding gls..." - endif + _debug "Finding gls..." if( { which gls } ) > /dev/null then setenv CSHENV_SYSTEM_LS USE_GNU_LS else if( "$CSHENV_SYSTEM" == "Linux" || "$CSHENV_SYSTEM" == "Cygwin" ) then @@ -30,19 +28,13 @@ if( $?CSHENV_USE_GNU_LS ) then else setenv CSHENV_SYSTEM_LS $CSHENV_SYSTEM endif - if( $?CSHENV_DEBUG ) then - echo "Done with gls probe..." - endif + _debug "Done with gls probe..." else - if( $?CSHENV_DEBUG ) then - echo "Trying for other ls options..." - endif + _debug "Trying for other ls options..." if( $?CSHENV_USE_BUILTIN_LS ) then setenv CSHENV_SYSTEM_LS USE_BUILTIN_LS else - if( $?CSHENV_DEBUG ) then - echo "Defaulting on ls..." - endif + _debug "Defaulting on ls..." setenv CSHENV_SYSTEM_LS ${CSHENV_SYSTEM} endif endif diff --git a/tcshrc.prompt.defs b/tcshrc.prompt.defs index cc68415..2633246 100644 --- a/tcshrc.prompt.defs +++ b/tcshrc.prompt.defs @@ -2,9 +2,7 @@ ### PROMPT DEFINITIONS ### ########################## -if( $?CSHENV_DEBUG ) then - echo "Sourcing prompt setup and definitions..." -endif +_debug "Sourcing prompt setup and definitions..." which shuf >& /dev/null if( $? == 0 ) then @@ -13,9 +11,7 @@ endif if( ! $?unknown_tty ) then set unknown_tty="?" - if( $?CSHENV_DEBUG ) then - echo "Unknown tty set..." - endif + _debug "Unknown tty set..." endif From c37ae62f1d6d9fa9f2fa619dd2afc2409fd64d08 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Wed, 24 Jun 2026 00:46:26 -0400 Subject: [PATCH 09/13] All the debugging I could find. --- startup_hooks/tcshrc | 4 ++- tcshrc.prompt.defs | 4 +-- tcshrc.prompt.final | 35 +++++++--------------- tcshrc.system | 12 ++------ tcshrc.system.Darwin | 8 ++--- tcshrc.system.FreeBSD | 8 ++--- tcshrc.system.Linux | 8 ++--- tcshrc.system.common | 69 +++++++++++-------------------------------- 8 files changed, 42 insertions(+), 106 deletions(-) diff --git a/startup_hooks/tcshrc b/startup_hooks/tcshrc index 199c483..ce532d9 100644 --- a/startup_hooks/tcshrc +++ b/startup_hooks/tcshrc @@ -30,7 +30,9 @@ if( $?CSHENV_DEBUG ) then echo "Set (in tcshrc hook) CSHENV_DIR to: " ${CSHENV_DIR} endif -alias _debug 'eval "if ( $?CSHENV_DEBUG ) echo \!*"' +alias _debug "eval 'if ( $?CSHENV_DEBUG ) echo \!*'" +_debug "Debug setup..." +_debug "Debug setup... (Paren test)" setenv LC_NUMERIC en_US.UTF-8 setenv LC_MEASUREMENT en_US.UTF-8 diff --git a/tcshrc.prompt.defs b/tcshrc.prompt.defs index 2633246..a41d7f7 100644 --- a/tcshrc.prompt.defs +++ b/tcshrc.prompt.defs @@ -132,9 +132,7 @@ set date_prompt="%{%Y-%W-%D%}" set time_prompt="%{%P%}" #unset edit -if( $?CSHENV_DEBUG ) then - echo "Building Cool prompt" -endif +_debug "Building Cool prompt" set depth_prompt="(${shlvl})" diff --git a/tcshrc.prompt.final b/tcshrc.prompt.final index 2bb063d..61ed808 100644 --- a/tcshrc.prompt.final +++ b/tcshrc.prompt.final @@ -12,9 +12,7 @@ # echo "Loaded prompt session information." #endif -if( $?CSHENV_DEBUG ) then - echo "Setting up dynamic colour loading..." -endif +_debug "Setting up dynamic colour loading..." # Recompute cached sgr codes from any configuration updates if( ! $?curr_branch_color ) then @@ -145,7 +143,7 @@ if( "${curr_prompt_color}" != "${prompt_color}" ) then set prompt_color_seq="%{[`__build_sgr_code no-csi reset ${curr_prompt_color}`m%}" endif -if( $?CSHENV_DEBUG ) echo "Dynamic color loading processed..." +_debug "Dynamic color loading processed..." @@ -167,9 +165,7 @@ set strong_battery_level = 75 while( ${prompt_hcolor} == 0 ) - if( $?CSHENV_DEBUG ) then - echo colorshuffle - endif + _debug colorshuffle #echo  # Shuffle, if supported if( $?CSHENV_DETECTED_SHUF ) then @@ -189,9 +185,7 @@ end while( ${prompt_hsym} == 0 ) - if( $?CSHENV_DEBUG ) then - echo symbolshuffle - endif + _debug symbolshuffle #echo  if( $?CSHENV_DETECTED_SHUF ) then set referencechars=`shuf -e $referencechars` @@ -213,8 +207,8 @@ end @ prompt_hsym = ${prompt_hsym} + 1 if( $?CSHENV_DEBUG ) then - echo ${prompt_hcolor} ${prompt_hsym} - echo "Setting prompt" + _debug ${prompt_hcolor} ${prompt_hsym} + _debug "Setting prompt" endif @@ -328,9 +322,7 @@ set date_prompt_view="" set battery_prompt_view="" set internal_bracket_view="" -if( $?CSHENV_DEBUG ) then - echo "About to setup prompt members, with disable checks" -endif +_debug "About to setup prompt members, with disable checks" if( ! $?CSHENV_DISABLE_PROMPT_SIGIL ) then set prompt_reference_view="${prompt_reference}" @@ -352,9 +344,8 @@ if( ! $?CSHENV_DISABLE_PROMPT_NESTING ) then endif endif -if( $?CSHENV_DEBUG ) then - echo "Up to the user and host checks..." -endif + +_debug "Up to the user and host checks..." set host_prompt_tail=": " if( ! $?CSHENV_DISABLE_PROMPT_USER ) then set user_prompt_view="${user_color_seq}${user_prompt}%{${sgr_reset}%}" @@ -384,9 +375,7 @@ if( ! $?CSHENV_DISABLE_PROMPT_DIRS ) then endif endif -if( $?CSHENV_DEBUG ) then - echo "Up to the time, date, and battery checks..." -endif +_debug "Up to the time, date, and battery checks..." if( ! $?CSHENV_DISABLE_PROMPT_TIME ) then set time_prompt_view="%{${time_color_seq}%}${time_prompt}%{${sgr_reset}%}" endif @@ -397,9 +386,7 @@ if( ! $?CSHENV_DISABLE_PROMPT_BATTERY ) then set battery_prompt_view="${battery_prefix}${battery_prompt}" endif -if( $?CSHENV_DEBUG ) then - echo "Doing the internal bracket setup..." -endif +_debug "Doing the internal bracket setup..." set internal_bracket_prompt="${prompt_reference_view}${line_prompt_view}${depth_prompt_view}${line_spacer_view}${user_prompt_view}${at_view}${host_prompt_view}${git_prompt_view}${path_prompt_view}${dirs_prompt_view}" if( "" != "${internal_bracket_prompt}" ) then #echo "I see scratch -${prompt_reference_view}${line_prompt_view}${depth_prompt_view}${line_spacer_view}${user_prompt_view}${at_view}${host_prompt_view}${git_prompt_view}${path_prompt_view}${dirs_prompt_view}-" diff --git a/tcshrc.system b/tcshrc.system index 5d78918..1822e82 100644 --- a/tcshrc.system +++ b/tcshrc.system @@ -1,12 +1,8 @@ -if( $?CSHENV_DEBUG ) then - echo "Running tcshrc.system..." -endif +_debug "Running tcshrc.system..." setenv CSHENV_SYSTEM `uname` -if( $?CSHENV_DEBUG ) then - echo 'Initially detected that you are running on a "'${CSHENV_SYSTEM}'" system' -endif +_debug 'Initially detected that you are running on a "'${CSHENV_SYSTEM}'" system' @@ -15,9 +11,7 @@ endif #setenv CSHENV_SYSTEM Cygwin #endsw -if( $?CSHENV_DEBUG ) then - echo 'Detected that you are running on a "'${CSHENV_SYSTEM}'" system' -endif +_debug 'Detected that you are running on a "'${CSHENV_SYSTEM}'" system' # Source the common bits, since many systems often have lots in common. diff --git a/tcshrc.system.Darwin b/tcshrc.system.Darwin index 046e8ae..01ef112 100644 --- a/tcshrc.system.Darwin +++ b/tcshrc.system.Darwin @@ -1,6 +1,4 @@ -if( $?CSHENV_DEBUG ) then - echo "Sourcing tcshrc.system.Darwin..." -endif +_debug "Sourcing tcshrc.system.Darwin..." # Set the acknowledgement bit, essentially setenv CSHENV_SYSTEM_CONFIGURED Darwin @@ -21,9 +19,7 @@ setenv INFOPATH /opt/homebrew/share/info`test ${?INFOPATH} -eq 1 && echo :${INFO alias printf gprintf -if( $?CSHENV_DEBUG ) then - echo "Done sourcing tcshrc.system.Darwin..." -endif +_debug "Done sourcing tcshrc.system.Darwin..." ########################### # vim: ft=tcsh diff --git a/tcshrc.system.FreeBSD b/tcshrc.system.FreeBSD index 87827ce..ff0dc7a 100644 --- a/tcshrc.system.FreeBSD +++ b/tcshrc.system.FreeBSD @@ -1,6 +1,4 @@ -if( $?CSHENV_DEBUG ) then - echo "Sourcing tcshrc.system.FreeBSD..." -endif +_debug "Sourcing tcshrc.system.FreeBSD..." # Set the acknowledgement bit, essentially setenv CSHENV_SYSTEM_CONFIGURED FreeBSD @@ -10,9 +8,7 @@ setenv PAGER less alias printf gprintf -if( $?CSHENV_DEBUG ) then - echo "Done sourcing tcshrc.system.FreeBSD..." -endif +_debug "Done sourcing tcshrc.system.FreeBSD..." ########################### # vim: ft=tcsh diff --git a/tcshrc.system.Linux b/tcshrc.system.Linux index 8acfc47..3bde16c 100644 --- a/tcshrc.system.Linux +++ b/tcshrc.system.Linux @@ -1,6 +1,4 @@ -if( $?CSHENV_DEBUG ) then - echo "Sourcing tcshrc.system.Linux..." -endif +_debug "Sourcing tcshrc.system.Linux..." unsetenv CSHENV_BATTERY_DEVICE unsetenv CSHENV_SHOW_BATTERY_LEVEL @@ -12,9 +10,7 @@ end # Set the acknowledgement bit, essentially setenv CSHENV_SYSTEM_CONFIGURED Linux -if( $?CSHENV_DEBUG ) then - echo "Done sourcing tcshrc.system.Linux..." -endif +_debug "Done sourcing tcshrc.system.Linux..." ########################### # vim: ft=tcsh diff --git a/tcshrc.system.common b/tcshrc.system.common index b617a06..b2071aa 100644 --- a/tcshrc.system.common +++ b/tcshrc.system.common @@ -1,15 +1,11 @@ -if( $?CSHENV_DEBUG ) then - echo "Sourcing tcshrc.system.common" -endif +_debug "Sourcing tcshrc.system.common" set uname=`uname` set uname_a=`uname -a` set uname_p=`uname -p` set uname_m=`uname -m` -if( $?CSHENV_DEBUG ) then - echo "Setting uname -i tracker, based upon OS." -endif +_debug "Setting uname -i tracker, based upon OS." switch( ${CSHENV_SYSTEM} ) case Cygwin: @@ -27,48 +23,37 @@ switch( ${CSHENV_SYSTEM} ) breaksw endsw -if( $?CSHENV_DEBUG ) then - echo "Setting CSHENV_BASESYSTEM..." -endif +_debug "Setting CSHENV_BASESYSTEM..." setenv CSHENV_BASESYSTEM "${uname}" -if( $?CSHENV_DEBUG ) then - echo "Setting CSHENV_FULLSYSTEM..." -endif +_debug "Setting CSHENV_FULLSYSTEM..." setenv CSHENV_FULLSYSTEM "${uname_a}" +_debug "Done setting CSHENV_FULLSYSTEM..." switch ( ${CSHENV_SYSTEM} ) case Cygwin: - if( $?CSHENV_DEBUG ) then - echo "Using a Cygwin system..." - endif + _debug "Using a Cygwin system..." #Cygwin is like Linux, so we just... #FALLTHROUGH case Linux: - if( $?CSHENV_DEBUG ) then - echo "Using a Linux-like system (GLIBC, probably)..." - endif + _debug "Using a Linux-like system (GLIBC, probably)..." setenv CSHENV_CPU "${uname_m}" setenv CSHENV_MACH "${uname_p}" switch( CSHENV_CPU ) case m68k: - if( $?CSHENV_DEBUG ) then - echo "Running on a m68k based CPU, tweaks for system." - endif + _debug "Running on a m68k based CPU, tweaks for system." setenv CSHENV_ARCH ${uname_p} breaksw case armv71: - if( $?CSHENV_DEBUG ) then - echo "Running on an arm based CPU, tweaks for system." - endif + _debug "Running on an arm based CPU, tweaks for system." setenv CSHENV_ARCH arm breaksw @@ -80,9 +65,7 @@ switch ( ${CSHENV_SYSTEM} ) breaksw case Darwin: - if( $?CSHENV_DEBUG ) then - echo "Using a Darwin/MacosX system..." - endif + _debug "Using a Darwin/MacosX system..." setenv CSHENV_CPU ${uname_p} setenv CSHENV_MACH ${uname_m} @@ -92,9 +75,7 @@ switch ( ${CSHENV_SYSTEM} ) breaksw case FreeBSD: - if( $?CSHENV_DEBUG ) then - echo "Using a FreeBSD system..." - endif + _debug "Using a FreeBSD system..." setenv CSHENV_CPU ${uname_p} setenv CSHENV_MACH ${uname_m} @@ -108,56 +89,42 @@ switch ( ${CSHENV_SYSTEM} ) breaksw endsw -if( $?CSHENV_DEBUG ) then - echo "Detecting hostname hacks needed." -endif +_debug "Detecting hostname hacks needed." switch( ${CSHENV_SYSTEM} ) #Broken or Non-BSD like hostname commands: case Cygwin: case SunOS: - if( $?CSHENV_DEBUG ) then - echo "SYSV hostname hack." - endif + _debug "SYSV hostname hack." setenv CSHENV_HOSTNAME `hostname | tr "[:upper:]" "[:lower:]"` breaksw #Linux may be different, yet still case Linux: - if( $?CSHENV_DEBUG ) then - echo "BSD-like hostname hack." - endif + _debug "BSD-like hostname hack." setenv CSHENV_HOSTNAME `hostname | tr "[:upper:]" "[:lower:]"` breaksw #BSD like hostnames, and non-broken ones. default: - if( $?CSHENV_DEBUG ) then - echo "BSD-like hostname hack." - endif + _debug "BSD-like hostname hack." setenv CSHENV_HOSTNAME `hostname -s| tr "[:upper:]" "[:lower:]"` breaksw endsw -if( $?CSHENV_DEBUG ) then - echo "Hostname detected as ${CSHENV_HOSTNAME}..." -endif +_debug "Hostname detected as ${CSHENV_HOSTNAME}..." if( $?CSHENV_VIRTUAL_HOSTNAME ) then setenv CSHENV_HOSTNAME ${CSHENV_VIRTUAL_HOSTNAME} - if( $?CSHENV_DEBUG ) then - echo "Hostname overriden as ${CSHENV_HOSTNAME}..." - endif + _debug "Hostname overriden as ${CSHENV_HOSTNAME}..." endif -if( $?CSHENV_DEBUG ) then - echo "Done sourcing tcshrc.system.common" -endif +_debug "Done sourcing tcshrc.system.common" ########################### # vim: ft=tcsh From a75180f6223ddc49f4dc44654eee1d1286a48b11 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Tue, 23 Jun 2026 19:09:28 -0400 Subject: [PATCH 10/13] New safe_source logic. --- tcshrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tcshrc b/tcshrc index fb16b15..ad8b5d0 100644 --- a/tcshrc +++ b/tcshrc @@ -53,10 +53,14 @@ endif _debug "Setting up optional sourcing mechanism." # This safe_source alias is incredibly delicate. It drives the whole # optional sourcing mechanism -- DO NOT MESS WITH IT! -alias safe_source 'eval "if ( -f \!:1 ) then \\ +alias old_safe_source 'eval "if ( -f \!:1 ) then \\ source \!:1 \\ endif"' +alias new_safe_source "test -f \!:1 && source \!:1" + +alias safe_source new_safe_source + _debug "Setting up optional session sourcing mechanism." # These reload_session and `__load_session` aliases ar incredibly delicate. They drives # the whole optional session mechanism -- DO NOT MESS WITH IT LIGHTLY! From 5d12f2dc32ba1ae0cc4398a17c8383d0185190b8 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Tue, 23 Jun 2026 19:10:18 -0400 Subject: [PATCH 11/13] Dynamic prompt colors cacheing loop --- tcshrc.prompt.final | 166 +++++++++++--------------------------------- 1 file changed, 39 insertions(+), 127 deletions(-) diff --git a/tcshrc.prompt.final b/tcshrc.prompt.final index 61ed808..1a4b385 100644 --- a/tcshrc.prompt.final +++ b/tcshrc.prompt.final @@ -14,134 +14,46 @@ _debug "Setting up dynamic colour loading..." + + # Recompute cached sgr codes from any configuration updates -if( ! $?curr_branch_color ) then - set curr_branch_color=impossible -endif -if( "${curr_branch_color}" != "${branch_color}" ) then - set curr_branch_color="${branch_color}" - set branch_color_seq="%{[`__build_sgr_code no-csi reset ${curr_branch_color}`m" -endif +set prompt_segment_kinds=( \ + branch \ + dirs \ + ahead_tracking \ + behind_tracking \ + percent \ + at \ + depth \ + line \ + path \ + host \ + date \ + time \ + text \ + brace \ + user \ + prompt \ + ) -if( ! $?curr_dirs_color ) then - set curr_dirs_color=impossible -endif -if( "${curr_dirs_color}" != "${dirs_color}" ) then - set curr_dirs_color="${dirs_color}" - set dirs_color_seq="%{[`__build_sgr_code no-csi reset ${curr_dirs_color}`m" -endif +foreach kind ( ${prompt_segment_kinds} ) + eval 'echo $?curr_'"${kind}"'_color' >& /dev/null + _debug "Eval of ${kind}" + if( $? == 0 ) then + eval "set curr_${kind}_color=impossible" + endif + eval 'set __new_this_color="${'"${kind}"'_color}"' + eval 'set __curr_this_color="${curr_'"${kind}"'_color}"' + if( "${__new_this_color}" != ${__curr_this_color} ) then + eval 'set curr_'"${kind}"'_color="'${__new_this_color}'"' + set __this_color_seq="%{[`__build_sgr_code no-csi reset ${__new_this_color}`m%}" + eval 'set '"${kind}"'_color_seq="'"${__this_color_seq}"'"' + endif +end -if( ! $?curr_ahead_tracking_color ) then - set curr_ahead_tracking_color=impossible -endif -if( "${curr_ahead_tracking_color}" != "${ahead_tracking_color}" ) then - set curr_ahead_tracking_color="${ahead_tracking_color}" - set ahead_tracking_color_seq="^[[`__build_sgr_code no-csi reset ${curr_ahead_tracking_color}`m" -endif +_debug "Done with color cacheing loop" + -if( ! $?curr_behind_tracking_color ) then - set curr_behind_tracking_color=impossible -endif -if( "${curr_behind_tracking_color}" != "${behind_tracking_color}" ) then - set curr_behind_tracking_color="${behind_tracking_color}" - set behind_tracking_color_seq="^[[`__build_sgr_code no-csi reset ${curr_behind_tracking_color}`m" -endif - -if( ! $?curr_percent_color ) then - set curr_percent_color=impossible -endif -if( "${curr_percent_color}" != "${percent_color}" ) then - set curr_percent_color="${percent_color}" - set percent_color_seq="[`__build_sgr_code no-csi reset ${curr_percent_color}`m" -endif - -if( ! $?curr_at_color ) then - set curr_at_color=impossible -endif -if( "${curr_at_color}" != "${at_color}" ) then - set curr_at_color="${at_color}" - set at_color_seq="%{[`__build_sgr_code no-csi reset ${curr_at_color}`m%}" -endif - -if( ! $?curr_depth_color ) then - set curr_depth_color=impossible -endif -if( "${curr_depth_color}" != "${depth_color}" ) then - set curr_depth_color="${depth_color}" - set depth_color_seq="%{[`__build_sgr_code no-csi reset ${curr_depth_color}`m%}" -endif - -if( ! $?curr_line_color ) then - set curr_line_color=impossible -endif -if( "${curr_line_color}" != "${line_color}" ) then - set curr_line_color="${line_color}" - set line_color_seq="%{[`__build_sgr_code no-csi reset ${curr_line_color}`m%}" -endif - -if( ! $?curr_path_color ) then - set curr_path_color=impossible -endif -if( "${curr_path_color}" != "${path_color}" ) then - set curr_path_color="${path_color}" - set path_color_seq="%{[`__build_sgr_code no-csi reset ${curr_path_color}`m%}" -endif - -if( ! $?curr_host_color ) then - set curr_host_color=impossible -endif -if( "${curr_host_color}" != "${host_color}" ) then - set curr_host_color="${host_color}" - set host_color_seq="%{[`__build_sgr_code no-csi reset ${curr_host_color}`m%}" -endif - -if( ! $?curr_date_color ) then - set curr_date_color=impossible -endif -if( "${curr_date_color}" != "${date_color}" ) then - set curr_date_color="${date_color}" - set date_color_seq="[`__build_sgr_code no-csi reset ${curr_date_color}`m" -endif - -if( ! $?curr_time_color ) then - set curr_time_color=impossible -endif -if( "${curr_time_color}" != "${time_color}" ) then - set curr_time_color="${time_color}" - set time_color_seq="[`__build_sgr_code no-csi reset ${curr_time_color}`m" -endif - -if( ! $?curr_text_color ) then - set curr_text_color=impossible -endif -if( "${curr_text_color}" != "${text_color}" ) then - set curr_text_color="${text_color}" - set text_color_seq="[`__build_sgr_code no-csi reset ${curr_text_color}`m" -endif - -if( ! $?curr_brace_color ) then - set curr_brace_color=impossible -endif -if( "${curr_brace_color}" != "${brace_color}" ) then - set curr_brace_color="${brace_color}" - set brace_color_seq="%{[`__build_sgr_code no-csi reset ${curr_brace_color}`m%}" -endif - -if( ! $?curr_user_color ) then - set curr_user_color=impossible -endif -if( "${curr_user_color}" != "${user_color}" ) then - set curr_user_color="${user_color}" - set user_color_seq="%{[`__build_sgr_code no-csi reset ${curr_user_color}`m%}" -endif - -if( ! $?curr_prompt_color ) then - set curr_prompt_color=impossible -endif -if( "${curr_prompt_color}" != "${prompt_color}" ) then - set curr_prompt_color="${prompt_color}" - set prompt_color_seq="%{[`__build_sgr_code no-csi reset ${curr_prompt_color}`m%}" -endif _debug "Dynamic color loading processed..." @@ -250,7 +162,7 @@ if( $?CSHENV_SHOW_BATTERY_LEVEL ) then #set battery_prompt="%{${battery_color}%}%{${battery_level}${at_color}\%%}%{${dim}%} " set battery_prefix="%{${csi}m${csi}28D%}" - set battery_prompt="%{${csi}38;2;128;128;255;3mBattery Level:${sgr_reset} ${battery_color}${battery_level}${percent_color_seq}%${sgr_reset} %}" + set battery_prompt="%{${csi}38;2;128;128;255;3mBattery Level:${sgr_reset} ${battery_color}${battery_level}%}${percent_color_seq}%{%${sgr_reset} %}" else set battery_prefix="" set battery_prompt="" @@ -377,10 +289,10 @@ endif _debug "Up to the time, date, and battery checks..." if( ! $?CSHENV_DISABLE_PROMPT_TIME ) then - set time_prompt_view="%{${time_color_seq}%}${time_prompt}%{${sgr_reset}%}" + set time_prompt_view="${time_color_seq}${time_prompt}%{${sgr_reset}%}" endif if( ! $?CSHENV_DISABLE_PROMPT_DATE ) then - set date_prompt_view="%{${date_color_seq}%}${date_prompt}%{${sgr_reset}%}" + set date_prompt_view="${date_color_seq}${date_prompt}%{${sgr_reset}%}" endif if( ! $?CSHENV_DISABLE_PROMPT_BATTERY ) then set battery_prompt_view="${battery_prefix}${battery_prompt}" From 2640c6cb251ce6d757d3c308543e78d59602a42f Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Wed, 24 Jun 2026 02:05:21 -0400 Subject: [PATCH 12/13] Make sgr builder more portable. I forgot a few BASHisms in the code. --- bin/__build_sgr_code | 67 +++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/bin/__build_sgr_code b/bin/__build_sgr_code index 29deac6..60ed83f 100755 --- a/bin/__build_sgr_code +++ b/bin/__build_sgr_code @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # This script will take an HTML compatible hex colour string and turn it into # a terminal sequence for true colour and other formats which best approximate @@ -85,7 +85,7 @@ map vga-brightwhite "ffffff" enable_greyscale_cheat=0 nocsi=0 -if [[ $1 == "no-csi" ]] +if [ "$1" = "no-csi" ] then nocsi=1 shift 1 @@ -103,17 +103,17 @@ dump_colors() *black*) text_color="ffffff" ;; *) text_color="000000" ;; esac - printf "%-24s${map[${key}]} |" ${key} + printf "%-24s$(map ${key} ) |" ${key} printf "`$0 reset reverse bg:${text_color} fg:${key}`native-sample`$0 reset`|" - if [[ ! -v CSHENV_TERMINAL_COLORS ]] || (( ${CSHENV_TERMINAL_COLORS} >= 256 )) + if [ -z "${CSHENV_TERMINAL_COLORS+x}" ] || [ ${CSHENV_TERMINAL_COLORS} -ge 256 ] then printf "`env CSHENV_TERMINAL_COLORS=256 $0 reset reverse bg:${text_color} fg:${key}`8-bit sample`$0 reset`|" fi - if [[ ! -v CSHENV_TERMINAL_COLORS ]] || (( ${CSHENV_TERMINAL_COLORS} >= 16 )) + if [ -z "${CSHENV_TERMINAL_COLORS+x}" ] || [ ${CSHENV_TERMINAL_COLORS} -ge 16 ] then printf "`env CSHENV_TERMINAL_COLORS=16 $0 reset reverse bg:${text_color} fg:${key}`4-bit sample`$0 reset`|" fi - if [[ ! -v CSHENV_TERMINAL_COLORS ]] || (( ${CSHENV_TERMINAL_COLORS} >= 8 )) + if [ -z "${CSHENV_TERMINAL_COLORS+x}" ] || [ ${CSHENV_TERMINAL_COLORS} -ge 8 ] then printf "`env CSHENV_TERMINAL_COLORS=8 $0 reset reverse bg:${text_color} fg:${key}`3-bit sample`$0 reset`|" fi @@ -127,15 +127,15 @@ cube_row() { r_base=${1} g=0 - while (( g < 6 )) + while [ ${g} -lt 6 ] do u=0 - while (( u < 3 )) + while [ ${u} -lt 3 ] do r=$(( r_base + u )) b=0 - while (( b < 6 )) + while [ ${b} -lt 6 ] do i=$(( 16 + ( r * 36 ) + ( g * 6 ) + ( b ) )) @@ -163,7 +163,7 @@ greyscale_chart() [ ${i} -ge 244 ] && txt=";30" local k=$(( i + 12 )) - while (( i < k )) + while [ ${i} -lt ${k} ] do printf "[48;5;${i};37;1${txt}m%3i " ${i} i=$(( i + 1 )) @@ -176,7 +176,7 @@ color_chart() i=0 # Base 16 - while (( i < 16 )) + while [ ${i} -lt 16 ] do [ ${i} -gt 0 ] && txt=";30" @@ -213,7 +213,7 @@ setup_color_depth() then use_3_bit=1 else - echo "ERROR!" 1>&2 ; exit -1 + echo "ERROR!" 1>&2 ; exit 255 fi fi } @@ -250,7 +250,7 @@ ansi_color() { if [ ${1} -gt 15 ] then - echo "ERROR!" 1>&2 ; exit -1 + echo "ERROR!" 1>&2 ; exit 255 elif [ ${1} -ge 8 ] then use_4_bit=1 @@ -269,17 +269,18 @@ ext_grey() grey_val=${1} if [ ${grey_val} -le 0 - ${grey_val} -gt 23 ] then - echo "ERROR!" 1>&2 ; exit -1 + echo "ERROR!" 1>&2 ; exit 255 fi ext_8_bit=$(( 232 + ${grey_val} )) } -function ext_rgb() +ext_rgb() { use_8_bit=1 - red_ext_val=$((6#${1:0:1})) - green_ext_val=$((6#${1:1:1})) - blue_ext_val=$((6#${1:2:1})) + red_ext_val="${1%??*}" + tmp="${1#?}" + green_ext_val=${tmp%?*} + blue_ext_val=${tmp#?*} ext_8_bit=$(( 16 + 36 * ${red_ext_val} + 6 * ${green_ext_val} + ${blue_ext_val} )) } @@ -288,7 +289,7 @@ ext_color() use_8_bit=1 if [ ${1} -gt 255 ] then - echo "ERROR!" 1>&2 ; exit -1 + echo "ERROR!" 1>&2 ; exit 255 else ext_8_bit=${1} fi @@ -298,17 +299,23 @@ rgb_color() { color=$1 case $1 in - [0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) color=${1:0:1}${1:0:1}${1:1:1}${1:1:1}${1:2:1}${1:2:1} ;; + [0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) + tmp="${color}" + color="${tmp%??*}${tmp%??*}" + tmp="${tmp#?}" + color="${color}${tmp%?*}${tmp%?*}${tmp#?}${tmp#?}" + ;; esac # First split off the red, green, and blue components... - red_hex=${color:0:2} - green_hex=${color:2:2} - blue_hex=${color:4:2} + red_hex="0x${color%????}" + color="${color#??}" + green_hex="0x${color%??}" + blue_hex="0x${color#??}" # Convert to decimal... - red_dec=$((16#${red_hex})) - green_dec=$((16#${green_hex})) - blue_dec=$((16#${blue_hex})) + red_dec=$((${red_hex})) + green_dec=$((${green_hex})) + blue_dec=$((${blue_hex})) if [ ${debug} -ne 0 ] then @@ -468,7 +475,7 @@ named_color() debug_print "${name} -> ${mapped}" if [ -z "${mapped}" ] then - echo "ERROR!" 1>&2 ; exit -1 + echo "ERROR!" 1>&2 ; exit 255 fi rgb_color ${mapped} @@ -506,8 +513,8 @@ build_sgr_code() fg:ext:rgb*) make_color 0 ext_rgb ${1#??????????} ;; fg:ext:*) make_color 0 ext_color ${1#???????} ;; # 12-bit color also supported - fg:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 0 rgb_color ${1:???} ;; - fg:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 0 rgb_color ${1:???} ;; + fg:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 0 rgb_color ${1#???} ;; + fg:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 0 rgb_color ${1#???} ;; bg:ansi:*) make_color 1 ansi_color ${1#????????} ;; bg:ext:grey*) make_color 1 ext_grey ${1#???????????} ;; @@ -517,6 +524,8 @@ build_sgr_code() bg:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 1 rgb_color ${1#???} ;; bg:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 1 rgb_color ${1#???} ;; + ul:ext:grey*) make_color 2 ext_grey ${1#???????????} ;; + ul:ext:rgb*) make_color 2 ext_rgb ${1#??????????} ;; ul:ext:*) make_color 2 ext_color ${1#???????} ;; # 12-bit color also supported ul:[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) make_color 2 rgb_color ${1#???} ;; From 429f45d1e878a1c31d7407ed03ab7156a6e176b6 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Wed, 24 Jun 2026 02:45:08 -0400 Subject: [PATCH 13/13] Add debug message to sigil generation. This will help indicate how much time is spent on it. --- tcshrc.prompt.defs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tcshrc.prompt.defs b/tcshrc.prompt.defs index a41d7f7..53c8280 100644 --- a/tcshrc.prompt.defs +++ b/tcshrc.prompt.defs @@ -104,6 +104,7 @@ set referencechars_raw="${referencechars_raw} 2620" set prompt_hcolor=0 set prompt_hsym=0 +_debug "Building unicode sigils table...." if( ! $?CSHENV_NO_UNICODE_PRINTF ) then set referencechars=() foreach ch ($referencechars_raw) @@ -114,6 +115,7 @@ else # Safe fallback for when there's no unicode printf set referencechars="A B C D X Y Z" endif +_debug "Done building unicode sigils table" # Rotation alias precmd 'source ${CSHENV_DIR}/tcshrc.prompt.final'