Квадратики в терминале
Moderator: posixru
Квадратики в терминале
Вроде бы банальная проблема, но я ничего толком не нагуглил. Либо устаревшие советы времен ядра 2.x (танцы вокруг koi-8 и все такое), либо советы про обычный терминал (а не графический, из XFCE), либо совет не работает.
LANG=ru_RU.utf8
В файле rc.font прописано setfont -v ter-v22b
Попытка написать то же самое в терминале XFCE выдает ошибку: Не удалось получить файловый дескриптор, указывающий на консоль
Что делать и кто виноват?
LANG=ru_RU.utf8
В файле rc.font прописано setfont -v ter-v22b
Попытка написать то же самое в терминале XFCE выдает ошибку: Не удалось получить файловый дескриптор, указывающий на консоль
Что делать и кто виноват?
Anyone who on 24 October, 1917 had a chance to snort cocaine on the deserted and inhuman Petrograd avenues, knows that man is not the king of nature. -- Victor Pelevin, "Crystal world"
-
- Posts: 525
- Joined: 20. Jun 2016, 20:15
Re: Квадратики в терминале
Nobody's to blame but for Russian the right font is ter-k22b. I just checked, all characters are properly rendered then.AlYuSed wrote:Что делать и кто виноват?
See /usr/doc/terminus-font-4.40/README to know more.
And xfce4-terminal is right, terminus fonts are in PSF format intended for the Linux console, not suitable under X. Try a DejaVu font instead, whatever.
PS Sorry I don't speak Russian and my native language is French, so I answer in English.
Re: Квадратики в терминале
It's just an idiom.DidierSpaier wrote:Nobody's to blame
https://fr.wikipedia.org/wiki/Que_faire ... nychevski)
https://en.wikipedia.org/wiki/Who_is_to_Blame%3F
KOI-8R is obsolete. Apparently, the man pages are written using this encoding, that's why I have everything well displayed in Russian, apart from them. As a quick and dirty solution I do this: LANG=C man slapt-getbut for Russian the right font is ter-k22b. I just checked, all characters are properly rendered then.
Russian letters are displayed normally with Terminus, but not in the man pages. The only difference is that now man pages do not display the squares, but the question marks.And xfce4-terminal is right, terminus fonts are in PSF format intended for the Linux console, not suitable under X. Try a DejaVu font instead, whatever.
I think I'll just switch the system language to English. I freely read technical English, so it is comfortable for me. Besides, this is not the only inconvenience. For example, folders in the home directory are created with Russian letters. They are displayed normally in the console and in GUI, but it is inconvenient: I have to switch from English keyboard layout to Russian and vice versa. But we are lazy slackers, right?PS Sorry I don't speak Russian and my native language is French, so I answer in English.
Anyone who on 24 October, 1917 had a chance to snort cocaine on the deserted and inhuman Petrograd avenues, knows that man is not the king of nature. -- Victor Pelevin, "Crystal world"
-
- Posts: 525
- Joined: 20. Jun 2016, 20:15
Re: Квадратики в терминале
It is not obsolete at all. It is just not intended for an X terminal, but only for a Linux console. And it is indeed suitable for Russian as it includes all the needed glyphs.AlYuSed wrote:KOI-8R is obsolete.
You can check that: just type in a Linux console (not in xfce4-terminal)
Code: Select all
showconsolefont
No. the man pages are written in UTF-8 encoding but the Terminus fonts include an UTF-8 table that maps the Unicode code point of a given character to its legacy 8-bits encoding, in this specific case KOI8-R.AlYuSed wrote:Apparently, the man pages are written using this encoding, that's why I have everything well displayed in Russian, apart from them.
This is necessary because a plain Linux console can display only a set of 256 character at any given time.
To overcome this limitation, you would need to use instead a framebuffer terminal like fbterm.
Not a solution at all.AlYuSed wrote:As a quick and dirty solution I do this: LANG=C man slapt-get
Again Terminus fonts are not intended for an X terminal at all.Russian letters are displayed normally with Terminus, but not in the man pages. The only difference is that now man pages do not display the squares, but the question marks.
The solution is to just setup correctly xfce4-terminal. I will refer to Terminal's menu in English.
1) Click Edit => Preferences => Appearance and choose for instance the font "DejaVu sans Mono Book" with the size you prefer.
2) Click Terminal => Set Encoding and choose "Default (UTF-8)"
If I do that, then start Terminal with LANG set to ru_RU.utf8 and type "man slapt-get", here is what I get:
Re: Квадратики в терминале
Это только в MAN? Попробуй в /etc/man.conf поменять строку "NROFF <что-то там>" на: "NROFF /usr/bin/groff -Dutf8 -Tutf8 -mandoc"
-
- Posts: 525
- Joined: 20. Jun 2016, 20:15
Re: Квадратики в терминале
In ~/.profile in Slint we writeI think that the same setting is made in Salix (maybe in another file like ~/.bashrc or ~/.bash_profile, I don't remember exactly).
Code: Select all
export GROFF_ENCODING=UTF-8
Re: Квадратики в терминале
Поменял, эффекта нет.reedych wrote:Это только в MAN? Попробуй в /etc/man.conf поменять строку "NROFF <что-то там>" на: "NROFF /usr/bin/groff -Dutf8 -Tutf8 -mandoc"
Anyone who on 24 October, 1917 had a chance to snort cocaine on the deserted and inhuman Petrograd avenues, knows that man is not the king of nature. -- Victor Pelevin, "Crystal world"
Re: Квадратики в терминале
There has already been written utf8, I changed to UTF-8, but to no avail.DidierSpaier wrote:In ~/.profile in Slint we writeI think that the same setting is made in Salix (maybe in another file like ~/.bashrc or ~/.bash_profile, I don't remember exactly).Code: Select all
export GROFF_ENCODING=UTF-8
I have a feeling that the cure is worse than the disease. I have already said that for me it is not a problem. I find it easier to change the system language to English.
Anyone who on 24 October, 1917 had a chance to snort cocaine on the deserted and inhuman Petrograd avenues, knows that man is not the king of nature. -- Victor Pelevin, "Crystal world"
Re: Квадратики в терминале
Давно такого не видел, но в памятках-рецептах проверенных на 13.37 по этому поводу имеется запись...AlYuSed wrote:Вроде бы банальная проблема, но я ничего толком не нагуглил. Либо устаревшие советы времен ядра 2.x (танцы вокруг koi-8 и все такое), либо советы про обычный терминал (а не графический, из XFCE), либо совет не работает.
Советуется содержимое файла /etc/rc.d/rc.font заменить на:
Code: Select all
#!/bin/sh
unicode_start LatArCyrHeb-16
for i in 1 2 3 4 5 6;do
echo -ne "\033%G" >/dev/tty$i
done
Re: Квадратики в терминале
Apparently, the problem is not in the system settings, because some man-pages are displayed correctly.
Anyone who on 24 October, 1917 had a chance to snort cocaine on the deserted and inhuman Petrograd avenues, knows that man is not the king of nature. -- Victor Pelevin, "Crystal world"