From 33e1dd77908c0ae9a12b07b8e88f4ae16a9e53bd Mon Sep 17 00:00:00 2001 From: romkatv Date: Sat, 17 Aug 2019 09:22:31 +0200 Subject: 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. --- config/p10k-classic.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config/p10k-classic.zsh') diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh index affca816..7d73e965 100644 --- a/config/p10k-classic.zsh +++ b/config/p10k-classic.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`. -- cgit v1.2.3