From 0d540a9391197ca4039246e4b5dc72b625d0df36 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Wed, 8 Jul 2009 12:59:31 +0200 Subject: [PATCH] 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. --- etc/zsh/zshrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.1.4