tide/functions/fish_prompt.fish
2020-05-08 15:32:58 -07:00

28 lines
764 B
Fish
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Created by lean configure
function fish_prompt --description 'Write out the prompt'
set -g last_pipestatus $pipestatus
set -g last_status $status
echo
set_color $lean_prompt_connection_color
printf "%.s$lean_prompt_connection_icon" (seq $COLUMNS)
set_color $fish_color_normal
echo -ne '\r'(lean_pwd)(lean_git_prompt)' '
set -l rightPrompt (lean_right_prompt)
set -l rightPromptStartLocation (math $COLUMNS-(string length (lean_decolor $rightPrompt)))
printf '\r\033['$rightPromptStartLocation'C'
echo $rightPrompt
# Prompt character
if test $last_status -eq 0
set_color $lean_color_green
else
set_color $fish_color_error
end
echo -n ' '
set_color $fish_color_normal
end