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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

28 line
686B

  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. echo -n -s "$USER" @
  19. set color_cwd $fish_color_cwd
  20. set suffix '>'
  21. end
  22. set -g fish_prompt_pwd_dir_length 0
  23. echo -n -s "$__fish_prompt_hostname" : (set_color $color_cwd) (prompt_pwd) (set_color normal) " $suffix "
  24. end