drasl/fish_prompt.fish
2024-04-22 17:57:47 +00:00

30 lines
474 B
Fish

function fish_prompt
set s $status
set p (basename (prompt_pwd))
if [ (echo "$p" | wc -m) -gt 32 ]
set p (echo "$p" | cut -c1-31)
set of "…"
end
set_color -o green
echo -n "["
set_color -o white
echo -n "$p"
if [ $of ]
set_color black
echo -n $of
end
if [ $s -ne 0 ]
set_color red
echo -n " $s"
end
set_color -o green
set g $(fish_git_prompt)
if [ $status = 0 ]
echo -n "]"
set_color -o purple
echo -n "$g "
else
echo -n "] "
end
end