From: Frank Terbeck Date: Wed, 8 Jul 2009 10:59:31 +0000 (+0200) Subject: zshrc: Insert a condition for loading /etc/default/locale X-Git-Tag: v0.3.73~13 X-Git-Url: https://git.grml.org/?a=commitdiff_plain;h=0d540a9391197ca4039246e4b5dc72b625d0df36;hp=ec28d009086f81e755b7b508445e5b7e3584ff44;p=grml-etc-core.git zshrc: Insert a condition for loading /etc/default/locale In 76706fcdd9c160d7f3212e597d2139f45531da72 we started loading /etc/default/locale unconditionally in order to pick up sane defaults for a given system. While this is a good idea in most cases, because users may still customize the locale for their interactive sessions in ~/.zshrc.local, this does cause problems when you need most of your shells in the default locale and a few in another from time to time. That is the case for 'iso-term' a script that changes utf8 parts of the default environment to iso885915 and then calls an x11 terminal emulator. This change enables us to conditionally turn off sourcing the default locale file by inserting ZSH_NO_DEFAULT_LOCALE=1 into the environment of the calling process. --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 43dab29..e747fe2 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -252,6 +252,7 @@ GRML_ZSH_CNF_HANDLER=${GRML_ZSH_CNF_HANDLER:-/usr/share/command-not-found/comman BATTERY=${BATTERY:-0} GRMLSMALL_SPECIFIC=${GRMLSMALL_SPECIFIC:-1} GRML_ALWAYS_LOAD_ALL=${GRML_ALWAYS_LOAD_ALL:-0} +ZSH_NO_DEFAULT_LOCALE=${ZSH_NO_DEFAULT_LOCALE:-0} if isgrmlcd ; then GRML_WARN_SKEL=${GRML_WARN_SKEL:-0} @@ -483,7 +484,9 @@ zrclocal() { #}}} # locale setup {{{ -xsource "/etc/default/locale" +if (( ZSH_NO_DEFAULT_LOCALE == 0 )); then + xsource "/etc/default/locale" +fi for var in LANG LC_ALL LC_MESSAGES ; do [[ -n ${(P)var} ]] && export $var