fish: Add tty-specific prompt

Since most (if not all) ttys will not support the arrow unicode
character, we remove it from the tty prompt.
This commit is contained in:
Donovan Glover 2018-11-30 18:38:44 -05:00
parent 62f4b07b24
commit 26c57a6b8d
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -2,20 +2,27 @@
# Copyright (C) 2017-2018 Donovan Glover
function fish_prompt
set pwd (basename $PWD)
set hostname (hostname)
if [ $pwd = $USER ]
set pwd "~"
# Use a more informative and non-unicode prompt for ttys
if status --is-login; and test -z "$DISPLAY"
set hostname (hostname)
set_color yellow; echo -n "$USER@$hostname"
set_color normal; echo -n " "
set_color magenta; echo -n "($PWD)"
else
set pwd (basename $PWD)
if [ $pwd = $USER ]
set pwd "~"
end
set_color magenta; echo -n "$pwd"
set_color normal; echo -n " "
set_color red; echo -n "➤"
set_color green; echo -n "➤"
set_color blue; echo -n "➤"
end
#set_color yellow; echo -n "$USER@$hostname"
#set_color normal; echo -n " "
#set_color magenta; echo -n "($pwd)"
set_color magenta; echo -n "$pwd"
set_color normal; echo -n " "
set_color red; echo -n "➤"
set_color green; echo -n "➤"
set_color blue; echo -n "➤"
set_color normal; echo -n " "
end