fish_prompt.fish 654 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. # Newline on tiny screens
  18. if test $COLUMNS -lt 50
  19. echo
  20. end
  21. __terlar_git_prompt
  22. __fish_hg_prompt
  23. echo
  24. if not test $last_status -eq 0
  25. set_color $fish_color_error
  26. echo -n $last_status
  27. end
  28. echo -n '➤ '
  29. set_color normal
  30. end