mirror of
https://github.com/oh-my-fish/theme-bobthefish.git
synced 2026-10-09 20:41:29 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user