Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fish_prompt
- set -l last_status $status
- set -l stat
- set -l input
- if test $last_status -ne 0
- set stat (set_color -o brred)"[$last_status]"(set_color normal)
- if fish_is_root_user
- set input (set_color -o magenta)"❯❯ "
- else
- set input (set_color -o red)"❯ "
- end
- else
- if fish_is_root_user
- set stat (set_color -o green)"[$last_status]"(set_color bryellow)
- set input (set_color yellow)"❯❯ "
- else
- set stat (set_color -o brcyan)"[$last_status]"(set_color normal)
- set input (set_color brgreen)"❯ "
- end
- end
- set -l place
- if string match -q -- '/mnt/c*' "$PWD"
- set place (wslpath -m "$PWD")
- else
- set place "$PWD"
- end
- set -l private # this is just to hide my hostname
- set -l host
- if not set -q private
- set host (prompt_hostname)
- else
- set host "[hostname]"
- end
- if fish_is_root_user
- echo (set_color red)'Fish: '(set_color -o brred)"root"(set_color normal)"@"(set_color red)"$host"
- echo (set_color -o magenta)"$place" "$stat" "$input"
- else
- echo (set_color bryellow)'Fish: '(set_color cyan)(whoami)(set_color normal)"@"(set_color magenta)"$host"
- echo (set_color -o brblue)"$place" "$stat" "$input"
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement