Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

fish_title.fish 523B

123456789101112131415161718192021222324
  1. function fish_title
  2. # Just calculate this once, to save a few cycles when displaying the prompt
  3. if not set -q __fish_prompt_hostname
  4. set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
  5. end
  6. set -l prefix
  7. set -l suffix
  8. switch $USER
  9. case root toor
  10. set prefix "$__fish_prompt_hostname:"
  11. set suffix '#'
  12. case '*'
  13. set prefix "$USER@$__fish_prompt_hostname:"
  14. set suffix '>'
  15. end
  16. if [ "$XDG_SESSION_TYPE" != "x11" ]
  17. echo -n -s "$prefix"
  18. end
  19. echo -n -s (prompt_pwd) " $suffix $_"
  20. end