Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#3582 - Regression in correct localization from 0.7 to 0.7.1
Attached to Project:
Arch Linux
Opened by Roman Kyrylych (Romashka) - Monday, 05 December 2005, 11:32 GMT
Last edited by Judd Vinet (judd) - Saturday, 17 December 2005, 18:29 GMT
Opened by Roman Kyrylych (Romashka) - Monday, 05 December 2005, 11:32 GMT
Last edited by Judd Vinet (judd) - Saturday, 17 December 2005, 18:29 GMT
|
Details(Sorry for my bad English...)
In 0.7.1 setting consoles to G0 Character Set is removed. This makes localization in non-UTF8 modes non-functional. But even if user adds echo -ne "\e(K" to /etc/rc.init the special escaping sequence in /etc/issue resets terminal back. I propose the following fix which is tested and 100% functional: 1) in /etc/rc.sysinit: see the following fixed code: . . . if [ "$CONSOLEFONT" != "" ]; then stat_busy "Loading Console Font: $CONSOLEFONT" for i in `seq 1 12`; do if [ "$CONSOLEMAP" != "" ]; then /usr/bin/setfont -m $CONSOLEMAP $CONSOLEFONT -C /dev/vc/${i} # IMHO trailing ; are not needed here else /usr/bin/setfont $CONSOLEFONT -C /dev/vc/${i}; # IMHO trailing ; are not needed here fi echo -ne "\e(K" >/dev/vc/${i} # ADD THIS LINE HERE!!! done stat_done fi . . . 2) in /etc/issue: replace first escape sequence with ^[[H^[[2J where ^[ is the escape char to do this simply echo -ne "\e[H[2J" >> /etc/issue and than replace the first line with the added line P.S.: in /etc/rc.sysinit and other init scripts: echo -ne "\033... may be replaced with echo -ne "\e... for better readability :) PLEASE, incorporate this fix in final 0.7.1! Without this many users who use non-Latin1 and non-UTF8 encodings will have troubles. |
This task depends upon
Will this fix be incorporated in the next initscripts release?
Just to confirm, is the bugtracker removing any escape sequences from these special sequences, or are these exactly correct?
echo -ne "\e(K"
echo -ne "\e[H\e[2J"
# If locale is *.utf set console to Unicode mode
if [ "`echo $LOCALE | /bin/grep -i utf`" ]; then
stat_busy "Setting Consoles to UTF-8"
/usr/bin/kbd_mode -u
/usr/bin/dumpkeys | /bin/loadkeys --unicode
for i in `seq 1 12`; do
echo -ne "\e%G" >/dev/vc/${i}
done
echo ' echo -ne "\e%G"'>>/etc/profile.d/locale.sh
if [ "$CONSOLEFONT" = "" ]; then
CONSOLEFONT="LatArCyrHeb-16"
fi
stat_done
fi
Thanks a lot.
Yes the escaping sequences is exactly the same as in my version. :-)
Sorry, I cannot test the newest rc.sysinit because I cannot copy it to my VMware machine (yet),
but section related to setting font and switching to G0 charset is exactly as in my version.
In section related to setting consoles to Unicode you made some changes which I have to test.
echo -ne "\e[H\e[2J >> /etc/issue replace the first line of /etc/issue with generated line.
I tried MC, nano and bash prompt.
Non-Latin chars are displayed but frames in MC are not displayed and everything is not in place.
When I switch to Ukrainian or Russian keyboard map and try typing something I get incorrect chars displayed.
The same thing happens with old rc.sysinit
And why you did change the Unicode section in rc.sysinit?
Did the new version works better for you?
echo ' echo -ne "\e%G"'>>/etc/profile.d/locale.sh
Very nice idea!
You can do the same with "\e(K":
echo 'echo -ne "\e(K"' >>/etc/profile.d/locale.sh
This way when user or software resets terminal - after relogin all fonts will be back to localized.
No more need to manually echo -ne "\e(K" after resetting terminal. :-)
Thanks for getting me to this idea!
Here is modified code:
if [ "$CONSOLEFONT" != "" ]; then
stat_busy "Loading Console Font: $CONSOLEFONT"
for i in `seq 1 12`; do
if [ "$CONSOLEMAP" != "" ]; then
/usr/bin/setfont -m $CONSOLEMAP $CONSOLEFONT -C /dev/vc/${i}
else
/usr/bin/setfont $CONSOLEFONT -C /dev/vc/${i}
fi
done
echo 'echo -ne "\e(K"' >>/etc/profile.d/locale.sh
stat_done
fi
And the space in echo ' echo... is unnecessary.
echo 'echo -ne "\e%G"' >>/etc/profile.d/locale.sh
is better.