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
|
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
|
then
|
||||||
ERROR_CHAR='<'
|
# assume we have UTF8 support
|
||||||
DIRTY_CHAR='^'
|
|
||||||
STASH_CHAR='≡' # ASCII 240
|
|
||||||
PREFIX='$'
|
|
||||||
else
|
|
||||||
ERROR_CHAR='⏎'
|
ERROR_CHAR='⏎'
|
||||||
DIRTY_CHAR="∆" # U+2206
|
DIRTY_CHAR="∆" # U+2206
|
||||||
STASH_CHAR='📚' # U+1F4DA
|
STASH_CHAR='📚' # U+1F4DA
|
||||||
PREFIX='❱' # U+2771
|
PREFIX='❱' # U+2771
|
||||||
|
else
|
||||||
|
# fallback to ASCII
|
||||||
|
ERROR_CHAR='<'
|
||||||
|
DIRTY_CHAR='^'
|
||||||
|
STASH_CHAR='≡' # ASCII 240
|
||||||
|
PREFIX='$'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
typeset -gA git_info
|
typeset -gA git_info
|
||||||
|
Loading…
Reference in New Issue
Block a user