Last active
March 16, 2024 14:16
-
-
Save cmaspi/0d18cad784982e9e4f3fcbc08cbe1102 to your computer and use it in GitHub Desktop.
this is my fish prompt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fish_prompt | |
set -l last_status $status | |
if not set -q VIRTUAL_ENV_DISABLE_PROMPT | |
set -g VIRTUAL_ENV_DISABLE_PROMPT true | |
end | |
set_color --bold yellow | |
printf '%s' $USER | |
set_color magenta | |
printf ' in ' | |
set_color cyan | |
printf '%s ' (prompt_pwd) | |
set isgit (git rev-parse --abbrev-ref HEAD 2> /dev/null) | |
set_color white | |
if test -n "$isgit" | |
printf '\033[1m</ %s >\033[0m ' $isgit | |
end | |
if test $last_status -eq 0 | |
set_color --bold brgreen | |
printf '[%s]' $last_status | |
else | |
set_color --bold brred | |
printf '[%s]' $last_status | |
end | |
set_color --bold white | |
printf '$ ' | |
set_color normal | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment