Advertisement
discrust

fish_greeting

May 18th, 2022 (edited)
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1.  
  2. # Defined in /usr/share/fish/functions/fish_greeting.fish @ line 1
  3. function fish_greeting
  4. if not set -q fish_greeting
  5. set -l line1 (_ 'Welcome to fish, the friendly interactive shell')
  6. set -l line2 \n(printf (_ 'Type %shelp%s for instructions on how to use fish') (set_color green) (set_color normal))
  7. set -g fish_greeting "$line1$line2"
  8. end
  9.  
  10. if set -q fish_private_mode
  11. set -l line (_ "fish is running in private mode, history will not be persisted.")
  12. if set -q fish_greeting[1]
  13. set -g fish_greeting $fish_greeting\n$line
  14. else
  15. set -g fish_greeting $line
  16. end
  17. end
  18.  
  19. # The greeting used to be skipped when fish_greeting was empty (not just undefined)
  20. # Keep it that way to not print superfluous newlines on old configuration
  21. test -n "$fish_greeting"
  22. and echo $fish_greeting
  23. end
  24.  
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement