Optimize prompt performance

- Replace external text-processing pipelines with fish builtins and loops.
 - Use cheaper prompt data sources for git state, user names, and path basenames.
 - Add native dotted-version comparison for Go prompt checks.
This commit is contained in:
Justin Hileman
2026-05-14 23:27:16 -04:00
parent c45a1ec53b
commit 72a89d4246
2 changed files with 97 additions and 32 deletions

View File

@@ -3,9 +3,11 @@
function __bobthefish_title_user -S -d 'Display actual user if different from $default_user'
if [ "$theme_title_display_user" = yes ]
if [ "$USER" != "$default_user" -o -n "$SSH_CLIENT" ]
set -l IFS .
uname -n | read -l host __
echo -ns (whoami) '@' $host ' '
set -l host (string split . -- (uname -n))[1]
[ -n "$USER" ]
and echo -ns $USER
or echo -ns (whoami)
echo -ns '@' $host ' '
end
end
end