aboutsummaryrefslogtreecommitdiff
path: root/internal/wizard.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-08-17 10:22:31 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-08-17 10:22:31 +0300
commit33e1dd77908c0ae9a12b07b8e88f4ae16a9e53bd (patch)
tree0986539021fa4045bb1cfdc001a63e88b42141c8 /internal/wizard.zsh
parent96ba1b6f7d54b455c008b61318c97ec0965b0033 (diff)
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.
Diffstat (limited to 'internal/wizard.zsh')
-rwxr-xr-xinternal/wizard.zsh4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/wizard.zsh b/internal/wizard.zsh
index 364446b2..b6bbd445 100755
--- a/internal/wizard.zsh
+++ b/internal/wizard.zsh
@@ -5,7 +5,9 @@ setopt noaliases
() {
setopt extended_glob no_prompt_{bang,subst} prompt_{cr,percent,sp}
-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
typeset -g __p9k_root_dir
typeset -gi force=0