1
Fork 0
mirror of https://github.com/Steffo99/config-fish.git synced 2024-10-16 14:27:34 +00:00
config-fish/functions/fish_prompt.fish

34 lines
657 B
Fish

function fish_prompt
set "STATUS" $status
set 'UID' (id -u)
if test "$UID" -eq 0
set_color brred
else if test "$UID" -lt 1000
set_color brpurple
else if test "$UID" -ge 60000
set_color brcyan
else
set_color green
end
echo -n "$USER"
set_color normal
echo -n "@"(prompt_hostname)":"
set_color brblue
echo -n (prompt_pwd)
if test $STATUS -ne 0
set_color brred
echo -n "$STATUS "
else
set_color normal
if test "$UID" -eq 0
echo -n "# "
else
echo -n "\$ "
end
end
set_color normal
end