mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-22 04:10:07 +00:00
more robust locale workaround in configs
This commit is contained in:
parent
1fd5087e91
commit
112648acb1
5 changed files with 24 additions and 17 deletions
|
@ -13,8 +13,7 @@
|
||||||
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
|
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
|
||||||
|
|
||||||
() {
|
() {
|
||||||
emulate -L zsh
|
emulate -L zsh -o extended_glob
|
||||||
setopt no_unset extended_glob
|
|
||||||
|
|
||||||
# Unset all configuration options. This allows you to apply configiguration changes without
|
# Unset all configuration options. This allows you to apply configiguration changes without
|
||||||
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
||||||
|
@ -23,8 +22,11 @@
|
||||||
autoload -Uz is-at-least && is-at-least 5.1 || return
|
autoload -Uz is-at-least && is-at-least 5.1 || return
|
||||||
|
|
||||||
zmodload zsh/langinfo
|
zmodload zsh/langinfo
|
||||||
if [[ ${langinfo[CODESET]:-} != (utf|UTF)(-|)8 ]]; then
|
if [[ ${langinfo[CODESET]:-} != (utf|UTF)(-|)8 && $+commands[locale] == 1 ]]; then
|
||||||
local LC_ALL=${${(@M)$(locale -a):#*.(utf|UTF)(-|)8}[1]:-en_US.UTF-8}
|
local -a loc
|
||||||
|
if loc=(${(@M)$(locale -a 2>/dev/null):#*.(utf|UTF)(-|)8}) && (( $#loc )); then
|
||||||
|
local LC_ALL=${loc[(r)(#i)C.UTF(-|)8]:-${loc[(r)(#i)en_US.UTF(-|)8]:-$loc[1]}}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The list of segments shown on the left. Fill it with the most important segments.
|
# The list of segments shown on the left. Fill it with the most important segments.
|
||||||
|
|
|
@ -13,8 +13,7 @@
|
||||||
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
|
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
|
||||||
|
|
||||||
() {
|
() {
|
||||||
emulate -L zsh
|
emulate -L zsh -o extended_glob
|
||||||
setopt no_unset extended_glob
|
|
||||||
|
|
||||||
# Unset all configuration options. This allows you to apply configiguration changes without
|
# Unset all configuration options. This allows you to apply configiguration changes without
|
||||||
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
||||||
|
@ -23,8 +22,11 @@
|
||||||
autoload -Uz is-at-least && is-at-least 5.1 || return
|
autoload -Uz is-at-least && is-at-least 5.1 || return
|
||||||
|
|
||||||
zmodload zsh/langinfo
|
zmodload zsh/langinfo
|
||||||
if [[ ${langinfo[CODESET]:-} != (utf|UTF)(-|)8 ]]; then
|
if [[ ${langinfo[CODESET]:-} != (utf|UTF)(-|)8 && $+commands[locale] == 1 ]]; then
|
||||||
local LC_ALL=${${(@M)$(locale -a):#*.(utf|UTF)(-|)8}[1]:-en_US.UTF-8}
|
local -a loc
|
||||||
|
if loc=(${(@M)$(locale -a 2>/dev/null):#*.(utf|UTF)(-|)8}) && (( $#loc )); then
|
||||||
|
local LC_ALL=${loc[(r)(#i)C.UTF(-|)8]:-${loc[(r)(#i)en_US.UTF(-|)8]:-$loc[1]}}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The list of segments shown on the left. Fill it with the most important segments.
|
# The list of segments shown on the left. Fill it with the most important segments.
|
||||||
|
|
|
@ -13,8 +13,7 @@
|
||||||
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
|
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
|
||||||
|
|
||||||
() {
|
() {
|
||||||
emulate -L zsh
|
emulate -L zsh -o extended_glob
|
||||||
setopt no_unset extended_glob
|
|
||||||
|
|
||||||
# Unset all configuration options. This allows you to apply configiguration changes without
|
# Unset all configuration options. This allows you to apply configiguration changes without
|
||||||
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
||||||
|
@ -23,8 +22,11 @@
|
||||||
autoload -Uz is-at-least && is-at-least 5.1 || return
|
autoload -Uz is-at-least && is-at-least 5.1 || return
|
||||||
|
|
||||||
zmodload zsh/langinfo
|
zmodload zsh/langinfo
|
||||||
if [[ ${langinfo[CODESET]:-} != (utf|UTF)(-|)8 ]]; then
|
if [[ ${langinfo[CODESET]:-} != (utf|UTF)(-|)8 && $+commands[locale] == 1 ]]; then
|
||||||
local LC_ALL=${${(@M)$(locale -a):#*.(utf|UTF)(-|)8}[1]:-en_US.UTF-8}
|
local -a loc
|
||||||
|
if loc=(${(@M)$(locale -a 2>/dev/null):#*.(utf|UTF)(-|)8}) && (( $#loc )); then
|
||||||
|
local LC_ALL=${loc[(r)(#i)C.UTF(-|)8]:-${loc[(r)(#i)en_US.UTF(-|)8]:-$loc[1]}}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The list of segments shown on the left. Fill it with the most important segments.
|
# The list of segments shown on the left. Fill it with the most important segments.
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
|
|
||||||
() {
|
() {
|
||||||
emulate -L zsh
|
emulate -L zsh
|
||||||
setopt no_unset
|
|
||||||
|
|
||||||
autoload -Uz is-at-least && is-at-least 5.1 || return
|
autoload -Uz is-at-least && is-at-least 5.1 || return
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,7 @@
|
||||||
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
|
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
|
||||||
|
|
||||||
() {
|
() {
|
||||||
emulate -L zsh
|
emulate -L zsh -o extended_glob
|
||||||
setopt no_unset extended_glob
|
|
||||||
|
|
||||||
# Unset all configuration options. This allows you to apply configiguration changes without
|
# Unset all configuration options. This allows you to apply configiguration changes without
|
||||||
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
# restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
|
||||||
|
@ -23,8 +22,11 @@
|
||||||
autoload -Uz is-at-least && is-at-least 5.1 || return
|
autoload -Uz is-at-least && is-at-least 5.1 || return
|
||||||
|
|
||||||
zmodload zsh/langinfo
|
zmodload zsh/langinfo
|
||||||
if [[ ${langinfo[CODESET]:-} != (utf|UTF)(-|)8 ]]; then
|
if [[ ${langinfo[CODESET]:-} != (utf|UTF)(-|)8 && $+commands[locale] == 1 ]]; then
|
||||||
local LC_ALL=${${(@M)$(locale -a):#*.(utf|UTF)(-|)8}[1]:-en_US.UTF-8}
|
local -a loc
|
||||||
|
if loc=(${(@M)$(locale -a 2>/dev/null):#*.(utf|UTF)(-|)8}) && (( $#loc )); then
|
||||||
|
local LC_ALL=${loc[(r)(#i)C.UTF(-|)8]:-${loc[(r)(#i)en_US.UTF(-|)8]:-$loc[1]}}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The list of segments shown on the left. Fill it with the most important segments.
|
# The list of segments shown on the left. Fill it with the most important segments.
|
||||||
|
|
Loading…
Reference in a new issue