mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-19 20:29:45 +01:00
Fix for bad LC_CTYPE entry
LANG is a colon-separated list of prefered locales; LC_CTYPE is single entry, therefore we need to remove all but one entry. Also, there is no need setting it if it is already set (LC_ALL also sets LC_CTYPE, so we check it too).
This commit is contained in:
parent
8830f65c4d
commit
448e966129
1 changed files with 12 additions and 2 deletions
14
lib/misc.zsh
14
lib/misc.zsh
|
@ -9,11 +9,21 @@ setopt long_list_jobs
|
|||
export PAGER="less"
|
||||
export LESS="-R"
|
||||
|
||||
export LC_CTYPE=$LANG
|
||||
|
||||
## super user alias
|
||||
alias _='sudo'
|
||||
alias please='sudo'
|
||||
|
||||
## more intelligent acking for ubuntu users
|
||||
alias afind='ack-grep -il'
|
||||
|
||||
## how to interpret text characters
|
||||
if [[ -z "$LC_CTYPE" && -z "$LC_ALL" ]]; then # only define if undefined
|
||||
export LC_CTYPE=${LANG%%:*} # pick the first entry from LANG
|
||||
[[ -z "$LC_CTYPE" ]] && \
|
||||
export LC_CTYPE=`locale -a | grep en_US.utf8 | head -1`
|
||||
[[ -z "$LC_CTYPE" ]] && \
|
||||
export LC_CTYPE=`locale -a | grep en_US | head -1`
|
||||
[[ -z "$LC_CTYPE" ]] && \
|
||||
export LC_CTYPE=C # default to internal encoding.
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue