Try harder when running on a system with incorrectly configured locale.
ZSH will still be broken when locale is misconfigured but at least p10k will work so users will look for help elsewhere. Fixes #173.
This commit is contained in:
parent
96ba1b6f7d
commit
33e1dd7790
5 changed files with 23 additions and 11 deletions
|
@ -16,7 +16,9 @@ fi
|
|||
() {
|
||||
emulate -L zsh
|
||||
setopt no_unset
|
||||
local LC_ALL=C.UTF-8
|
||||
if [[ ${LC_ALL:-${LANG:-}} != *.(utf|UTF)(-|)8 ]]; then
|
||||
local LC_ALL=${${(@M)$(locale -a):#*.(utf|UTF)(-|)8}[1]:-en_US.UTF-8}
|
||||
fi
|
||||
|
||||
# Unset all configuration options. This allows you to apply configiguration changes without
|
||||
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
||||
|
|
|
@ -16,7 +16,9 @@ fi
|
|||
() {
|
||||
emulate -L zsh
|
||||
setopt no_unset
|
||||
local LC_ALL=C.UTF-8
|
||||
if [[ ${LC_ALL:-${LANG:-}} != *.(utf|UTF)(-|)8 ]]; then
|
||||
local LC_ALL=${${(@M)$(locale -a):#*.(utf|UTF)(-|)8}[1]:-en_US.UTF-8}
|
||||
fi
|
||||
|
||||
# Unset all configuration options. This allows you to apply configiguration changes without
|
||||
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue