fish: make prompt colours a universal variable

This commit is contained in:
Nico 2026-02-20 00:58:36 +11:00
parent fa05bf798d
commit c6c8674a83
Signed by: nico
SSH key fingerprint: SHA256:XuacYOrGqRxC3jVFjfLROn1CSvLz85Dec6N7O9Gwu/0
2 changed files with 9 additions and 3 deletions

View file

@ -28,10 +28,10 @@ if status is-interactive
# set prompt colours
if test -e ~/.cache/zsh_colours.sh
posix-source (string replace -fra "{|}|#|\"" "" (cat ~/.cache/zsh_colours.sh) | psub)
posix-source-universal (string replace -fra "{|}|#|\"" "" (cat ~/.cache/zsh_colours.sh) | psub)
else
set PRIMARY_COLOUR blue
set SECONDARY_COLOUR purple
set -Ux PRIMARY_COLOUR blue
set -Ux SECONDARY_COLOUR purple
end

View file

@ -0,0 +1,6 @@
function posix-source-universal
for i in (cat $argv)
set arr (echo $i |tr = \n)
set -Ux $arr[1] $arr[2]
end
end