fish_title.fish 894 B

12345678910111213141516171819202122232425262728293031323334
  1. # You can override some default title options in your config.fish:
  2. # set -g theme_title_display_process no
  3. # set -g theme_title_display_path no
  4. # set -g theme_title_display_user yes
  5. # set -g theme_title_use_abbreviated_path no
  6. function __bobthefish_title_user -S -d 'Display actual user if different from $default_user'
  7. if [ "$theme_title_display_user" = 'yes' ]
  8. if [ "$USER" != "$default_user" -o -n "$SSH_CLIENT" ]
  9. set -l IFS .
  10. hostname | read -l hostname __
  11. echo -ns (whoami) '@' $hostname ' '
  12. end
  13. end
  14. end
  15. function fish_title
  16. __bobthefish_title_user
  17. if [ "$theme_title_display_process" = 'yes' ]
  18. echo $_
  19. [ "$theme_title_display_path" != 'no' ]
  20. and echo ' '
  21. end
  22. if [ "$theme_title_display_path" != 'no' ]
  23. if [ "$theme_title_use_abbreviated_path" = 'no' ]
  24. echo $PWD
  25. else
  26. prompt_pwd
  27. end
  28. end
  29. end