You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1021 B

  1. function fish_prompt --description 'Write out the prompt'
  2. set -l last_pipestatus $pipestatus
  3. set -l last_status $status
  4. set -l normal (set_color normal)
  5. # Color the prompt differently when we're root
  6. set -l color_cwd $fish_color_cwd
  7. set -l prefix
  8. set -l suffix '>'
  9. if contains -- $USER root toor
  10. if set -q fish_color_cwd_root
  11. set color_cwd $fish_color_cwd_root
  12. end
  13. set suffix '#'
  14. end
  15. # If we're running via SSH, change the host color.
  16. set -l color_host $fish_color_host
  17. if set -q SSH_TTY
  18. set color_host $fish_color_host_remote
  19. end
  20. # Write pipestatus
  21. set -l prompt_status (__fish_print_pipestatus " [" "]" "|" (set_color $fish_color_status) (set_color --bold $fish_color_status) $last_pipestatus)
  22. echo -n -s (set_color $fish_color_user) "$USER" $normal @ (set_color $color_host) (prompt_hostname) $normal ' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal $prompt_status $suffix " "
  23. end