Arch Linux

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!
Tasklist

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
Task Type Bug Report
Category System
Status Closed
Assigned To Judd Vinet (judd)
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7 Wombat
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

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

Closed by  Judd Vinet (judd)
Friday, 06 January 2006, 08:49 GMT
Reason for closing:  Fixed
Comment by Roman Kyrylych (Romashka) - Monday, 05 December 2005, 11:33 GMT
ooops... echo -ne "\e[H\e[2J" >> /etc/issue
Comment by Roman Kyrylych (Romashka) - Saturday, 10 December 2005, 12:06 GMT
Status???
Will this fix be incorporated in the next initscripts release?
Comment by Judd Vinet (judd) - Tuesday, 13 December 2005, 03:19 GMT
Yes, this will go in the next initscripts. Thanks, Roman.

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"
Comment by Judd Vinet (judd) - Tuesday, 13 December 2005, 03:26 GMT
While you're helping me with localization... does this block work correctly?

# 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
Comment by Judd Vinet (judd) - Tuesday, 13 December 2005, 04:08 GMT
Here's the latest version of rc.sysinit, Roman. Please test it for me if you can, including the utf8 stuff.

Thanks a lot.
Comment by Roman Kyrylych (Romashka) - Tuesday, 13 December 2005, 08:19 GMT
Thanks Judd!
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.
Comment by Roman Kyrylych (Romashka) - Tuesday, 13 December 2005, 08:21 GMT
And please remember to do
echo -ne "\e[H\e[2J >> /etc/issue replace the first line of /etc/issue with generated line.
Comment by Roman Kyrylych (Romashka) - Tuesday, 13 December 2005, 08:23 GMT
I'll do more testing of new rc.sysinit related to Unicode.
Comment by Roman Kyrylych (Romashka) - Tuesday, 13 December 2005, 11:49 GMT
UTF-8 is not working for me.
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
Comment by Roman Kyrylych (Romashka) - Tuesday, 13 December 2005, 11:55 GMT
What is /proc/cmdline and how to add quiet to it?

And why you did change the Unicode section in rc.sysinit?
Did the new version works better for you?
Comment by Roman Kyrylych (Romashka) - Wednesday, 14 December 2005, 14:18 GMT
I noted that you exported echo -ne "\e%G" to locale.sh
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.
Comment by Judd Vinet (judd) - Wednesday, 14 December 2005, 17:48 GMT
If I put the echo -ne "\e(K"' in locale.sh, will it hinder users from logging in at the console? If the echo is in locale.sh, it won't be run til AFTER the user logs in.

Loading...