aboutsummaryrefslogtreecommitdiffstats
path: root/lang.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lang.sh')
-rwxr-xr-xlang.sh21
1 files changed, 18 insertions, 3 deletions
diff --git a/lang.sh b/lang.sh
index 6b186ce6..e8b1a911 100755
--- a/lang.sh
+++ b/lang.sh
@@ -40,11 +40,13 @@ if [ "$sourced" = 1 ]; then
[ -n "$LANGUAGE" ] && export LANGUAGE || unset LANGUAGE
[ -n "$LINGUAS" ] && export LINGUAS || unset LINGUAS
[ -n "$_XKB_CHARSET" ] && export _XKB_CHARSET || unset _XKB_CHARSET
+
+ consoletype=$(/sbin/consoletype)
if [ -n "$CHARSET" ]; then
case $CHARSET in
8859-1|8859-2|8859-5|8859-15|koi*)
- if [ "$TERM" = "linux" -a "`/sbin/consoletype`" = "vt" ]; then
+ if [ "$TERM" = "linux" -a "$consoletype" = "vt" ]; then
echo -n -e '\033(K' 2>/dev/null > /proc/$$/fd/0
fi
;;
@@ -52,7 +54,7 @@ if [ "$sourced" = 1 ]; then
elif [ -n "$SYSFONTACM" ]; then
case $SYSFONTACM in
iso01*|iso02*|iso05*|iso15*|koi*|latin2-ucw*)
- if [ "$TERM" = "linux" -a "`/sbin/consoletype`" = "vt" ]; then
+ if [ "$TERM" = "linux" -a "$consoletype" = "vt" ]; then
echo -n -e '\033(K' 2>/dev/null > /proc/$$/fd/0
fi
;;
@@ -61,12 +63,25 @@ if [ "$sourced" = 1 ]; then
if [ -n "$LANG" ]; then
case $LANG in
*.utf8*|*.UTF-8*)
+ if [ "$consoletype" = "vt" -o "$consoletype" = "pty" ]; then
+ stty iutf8
+ fi
if [ "$TERM" = "linux" ]; then
- if [ "`/sbin/consoletype`" = "vt" ]; then
+ if [ "$consoletype" = "vt" ]; then
[ -x /bin/unicode_start ] && /sbin/consoletype fg && /bin/unicode_start $SYSFONT $SYSFONTACM
fi
fi
;;
+ *)
+ if [ "$consoletype" = "vt" -o "$consoletype" = "pty" ]; then
+ stty -iutf8
+ fi
+ if [ "$TERM" = "linux" ]; then
+ if [ "$consoletype" = "vt" ]; then
+ [ -x /bin/unicode_stop ] && /sbin/consoletype fg && /bin/unicode_stop
+ fi
+ fi
+ ;;
esac
fi