Improve behaviour on platforms without locale
(ie Termux)
This commit is contained in:
parent
f7ebd0e09d
commit
e5f226f93a
@ -4,17 +4,21 @@
|
||||
|
||||
setopt nopromptbang promptcr promptpercent promptsp promptsubst
|
||||
|
||||
if [[ $(locale charmap) != UTF-8 || "$TERM" == linux ]]
|
||||
if [[ "$TERM" != linux && \
|
||||
("$LANG" =~ UTF-?8$ || \
|
||||
"$(! (which locale > /dev/null) || locale charmap)" == UTF-8) ]]
|
||||
then
|
||||
ERROR_CHAR='<'
|
||||
DIRTY_CHAR='^'
|
||||
STASH_CHAR='≡' # ASCII 240
|
||||
PREFIX='$'
|
||||
else
|
||||
# assume we have UTF8 support
|
||||
ERROR_CHAR='⏎'
|
||||
DIRTY_CHAR="∆" # U+2206
|
||||
STASH_CHAR='📚' # U+1F4DA
|
||||
PREFIX='❱' # U+2771
|
||||
else
|
||||
# fallback to ASCII
|
||||
ERROR_CHAR='<'
|
||||
DIRTY_CHAR='^'
|
||||
STASH_CHAR='≡' # ASCII 240
|
||||
PREFIX='$'
|
||||
fi
|
||||
|
||||
typeset -gA git_info
|
||||
|
Loading…
Reference in New Issue
Block a user