@@ -18,7 +18,7 @@ if ($LC_SOURCED == 1) then
1818 endif
1919 endif
2020
21- set consoletype= ` /sbin/consoletype stdout `
21+ set in_console= ` tty | grep -vc -e ' /dev/tty ' `
2222
2323 if ($? CHARSET) then
2424 switch ($CHARSET )
@@ -30,10 +30,8 @@ if ($LC_SOURCED == 1) then
3030 case KOI* :
3131 case LATIN2* :
3232 if ( $? TERM ) then
33- if ( " $TERM " == " linux" ) then
34- if ( " $consoletype " == " vt" ) then
33+ if ( " $TERM " == " linux" && in_console == 0 ) then
3534 /bin/echo -n -e ' \033(K' > /dev/tty
36- endif
3735 endif
3836 endif
3937 breaksw
@@ -49,10 +47,8 @@ if ($LC_SOURCED == 1) then
4947 case koi* :
5048 case latin2-ucw* :
5149 if ( $? TERM ) then
52- if ( " $TERM " == " linux" ) then
53- if ( " $consoletype " == " vt" ) then
50+ if ( " $TERM " == " linux" && in_console == 0 ) then
5451 /bin/echo -n -e ' \033(K' > /dev/tty
55- endif
5652 endif
5753 endif
5854 breaksw
@@ -63,8 +59,7 @@ if ($LC_SOURCED == 1) then
6359 case * .utf8* :
6460 case * .UTF-8* :
6561 if ( $? TERM ) then
66- if ( " $TERM " == " linux" ) then
67- if ( " $consoletype " == " vt" ) then
62+ if ( " $TERM " == " linux" && in_console == 0 ) then
6863 switch ($LANG )
6964 case en_IN* :
7065 breaksw
@@ -89,15 +84,13 @@ if ($LC_SOURCED == 1) then
8984 endif
9085 endif
9186 endif
92- endif
9387 endif
9488 endif
9589 endif
9690 breaksw
9791 case * :
9892 if ( $? TERM ) then
99- if ( " $TERM " == " linux" ) then
100- if ( " $consoletype " == " vt" ) then
93+ if ( " $TERM " == " linux" && in_console == 0 ) then
10194 switch ($LANG )
10295 case en_IN* :
10396 breaksw
@@ -117,12 +110,11 @@ if ($LC_SOURCED == 1) then
117110 /bin/unicode_stop
118111 endif
119112 endif
120- endif
121113 endif
122114 endif
123115 breaksw
124116 endsw
125- endif
117+ endif
126118 unsetenv SYSFONTACM
127119 unsetenv SYSFONT
128120 unset consoletype
0 commit comments