fish_prompt.fish 973 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. function fish_prompt --description 'Write out the prompt'
  2. set -l last_status $status
  3. # User
  4. set_color $fish_color_user
  5. echo -n (whoami)
  6. set_color normal
  7. echo -n '@'
  8. # Host
  9. set_color $fish_color_host
  10. echo -n (prompt_hostname)
  11. set_color normal
  12. echo -n ':'
  13. # PWD
  14. set_color $fish_color_cwd
  15. echo -n (prompt_pwd)
  16. set_color normal
  17. # Second line
  18. echo
  19. # Error status
  20. if not test $last_status -eq 0
  21. set_color $fish_color_error
  22. echo -n $last_status
  23. set_color normal
  24. end
  25. # Purpose
  26. set -q FISH_SHELL_PURPOSE
  27. if test $status -eq 0
  28. set_color normal
  29. echo -n '['
  30. end
  31. set_color blue
  32. echo -n $FISH_SHELL_PURPOSE
  33. set_color normal
  34. # VCS
  35. __terlar_git_prompt
  36. __fish_hg_prompt
  37. echo
  38. # Color arrow with error
  39. if not test $last_status -eq 0
  40. set_color $fish_color_error
  41. end
  42. echo -n '➤ '
  43. set_color normal
  44. end