From ea96ee93f6de32b660bea304573f7515f6b00b0c Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Sun, 28 Jun 2026 08:42:56 -0400 Subject: [PATCH] Migrate git branch symbol gen to static This should cut down on forks when within the git handling part of prompt gen. --- tcshrc.prompt.defs | 10 ++++++++++ tcshrc.prompt.final | 9 --------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tcshrc.prompt.defs b/tcshrc.prompt.defs index 8a27d97..1e06d3b 100644 --- a/tcshrc.prompt.defs +++ b/tcshrc.prompt.defs @@ -14,6 +14,16 @@ if( ! $?unknown_tty ) then _debug "Unknown tty set..." endif +if( ! $?CSHENV_NO_UNICODE_PRINTF ) then + # If the font doesn't support the special branch symbol... + #set branch_symbol=`printf "\uE0A0"` + + # I prefer to use this one... (keep padded spaces... for alignment) + set branch_symbol=`printf '\u2387'` +else + # Non unicode fallback 'X' + set branch_symbol='X' +endif set reference_colors=() set referencechars=() diff --git a/tcshrc.prompt.final b/tcshrc.prompt.final index c35ab51..e75856c 100644 --- a/tcshrc.prompt.final +++ b/tcshrc.prompt.final @@ -170,15 +170,6 @@ if( 0 == ${__res} ) then #set git_prompt="%{${csi}${branch_indent}C${csi}mBranch: ${csi}3;38;2;255;192;192m${git_branch}${csi}m${csi}${branch_space}C\n%}" - if( ! $?CSHENV_NO_UNICODE_PRINTF ) then - # If the font doesn't support the special branch symbol... - set branch_symbol=`printf "\uE0A0"` - # I could always fallback to this one... (keep padded spaces... for alignment) - set branch_symbol=`printf '\u2387\ \ '` - else - # Non unicode fallback 'X' - set branch_symbol='X' - endif git rev-list --count --left-right \@\{upstream\}..HEAD>&/dev/null set __res=$? #echo "Got: ${git_counts}"