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.

27 lines
673B

  1. # target format: user@host:~$
  2. function fish_prompt --description 'prompt'
  3. # Just calculate this once, to save a few cycles when displaying the prompt
  4. if not set -q __fish_prompt_hostname
  5. set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
  6. end
  7. set -l color_cwd
  8. set -l suffix
  9. switch $USER
  10. case root toor
  11. if set -q fish_color_cwd_root
  12. set color_cwd $fish_color_cwd_root
  13. else
  14. set color_cwd $fish_color_cwd
  15. end
  16. set suffix '#'
  17. case '*'
  18. set color_cwd $fish_color_cwd
  19. set suffix '>'
  20. end
  21. set -g fish_prompt_pwd_dir_length 0
  22. echo -n -s "$USER" @ "$__fish_prompt_hostname" : (set_color $color_cwd) (prompt_pwd) (set_color normal) " $suffix "
  23. end