Generally, the text mode setup is the easiest way to show and input cyrillic characters. There is one significant complication, however: the text mode fonts and keyboard layout manipulations depend on terminal driver implementation. Therefore, there is no portable way to achieve the goal accross different systems.
Right now, I describe the way to deal with the Linux console driver. Thus, if you have another system, dont expect it to work for you. Instead, consult your terminal driver manual. Nevertheless, send me any information you find, so I'll be able to include it in futher versions of this document.
The Linux console driver is quite a flexible piece of software. It is capable of changing fonts as well as keyboard layouts. To achieve it, you'll need the kbd package. Both RedHat and Slackware install kbd as part of a system.
The kbd package contains keyboard control utilities as well as a big collection of fonts and keyboard layouts.
Cyrillic setup with kbd usually involves two things:
setfont
program. The fonts files are located in
/usr/lib/kbd/consolefonts
.
NOTE: Never run the setfont
program under X because it will hang
your system. This is because it works with low-level video card calls
which X doesn't like.
loadkeys
program.
NOTE: In RedHat 3.0.3, /usr/bin/loadkeys
has too restrictive
access permissions, namely 700 (rwx------
). There are no reasons
for that, since everyone may compile his own copy and execute it (the
appropriate system calls are not root-only). Thus, just ask your
sysadmin to set more reasonable permissions for it (for example, 755).
The following is an excerpt from my cyrload
script, which sets
up the Cyrillic mode for Linux console:
if [ notset.$DISPLAY != notset. ]; then echo "`basename $0`: cannot run under X" exit fi loadkeys /usr/lib/kbd/keytables/ru.map setfont /usr/lib/kbd/consolefonts/koi-8x16 echo "Use the right Ctrl key to switch the mode..."
Now you probably want to test it. Do the appropriate bash or tcsh
setup, rerun it, then press the right Control
key and make sure
you are getting the cyrillic characters right. The 'q
' key must
produce russian "short i
" character, 'w
' generates
"ts
", etc.
If you've screwed something up, the very best thing to do is to reset to the original (that is, US) settings. Execute the following commands:
loadkeys /usr/lib/kbd/keytables/defkeymap.map setfont /usr/lib/kbd/consolefonts/default8x16
NOTE: unfortunately enough, the console driver is not able to preserve it's state (at least easily enough), while running the X Window System. Therefore, after you leave the X (or switch from it to a console), you have to reload the console russian font.