X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/2d18398ae92f3da8ef49fe8e376ff5cdab53608a..2c5e5338197eba2b79ba35e838f74905b0e99860:/bash_profile diff --git a/bash_profile b/bash_profile index 57475a8..37ed0ea 100644 --- a/bash_profile +++ b/bash_profile @@ -112,18 +112,23 @@ umask 002 [ -z "$HOST" ] && export HOST=`hostname` -if [ "$DISPLAY" = "" ]; then - : ${LC_CTYPE=${LANG-${LC_ALL-`mdw-conf console-ctype`}}} +if [ "$DISPLAY" != "" ]; then + LANG=`mdw-conf x-ctype` else - LC_CTYPE=`mdw-conf x-ctype` + : ${LANG=${LC_CTYPE-${LC_ALL-`mdw-conf console-ctype`}}} + case "$TERM,`tty`" in + linux,/dev/tty*) + if vt-is-UTF8 >/dev/null 2>&1; then + ctype=.utf8 + else + ctype= + fi + LANG=${LANG%.*}$ctype + ;; + esac fi -unset LANG LC_ALL -export LC_CTYPE - -for lc in TIME NUMERIC MONETARY PAPER NAME ADDRESS TELEPHONE MEASUREMENT; do - eval "export LC_$lc=$LC_CTYPE" -done -export LC_COLLATE=POSIX +unset LC_ALL +export LC_COLLATE=POSIX LANG __mdw_programp distcc && export CCACHE_PREFIX=distcc @@ -150,10 +155,10 @@ export P4PORT=`mdw-conf p4-port` P4USER=`mdw-conf p4-user` export BECOME="--preserve-environment" -export PAGER=`type -p less` METAMAIL_PAGER=`type -p less` +export MDW_PAGER=`type -p less` PAGER=mdw-pager METAMAIL_PAGER=mdw-pager export LESS="-iqgRh1FX" export LESSOPEN="|lesspipe.sh %s" -case "$LC_CTYPE" in +case "${LC_CTYPE-$LANG}" in *utf8 | *utf-8 | *UTF8 | *UTF-8) LESSCHARSET=utf-8 ;; *) LESSCHARSET=latin1 ;; esac