Make TTY font huge

Frankly, the default tty font in modern Linux distros is way out of line. First, it is so tiny that it is evil. It should respect 80 characters width or something close to that. Second, the font can be configured on a way too limited base. Moreover, it does not display in nice full xterm-256color colours. Luckily, all this can be fixed.

Fix Number One

  1. Have terminal-font installed.
  2. Log in to tty.
  3. Pass setfont ter-232b

The font will become way bigger, about the right size (fitting a bit over 80 characters on an HD screen). You can make it permanent in /etc/vconsole.conf or explore other sizes.

It is possible to also change the colours in tty by inheriting them from .Xresources. To do this, insert the following into .bashrc1

if [ "$TERM" = "linux" ]; then
    _SEDCMD='s/.*\*color\([0-9]\{1,\}\).*#\([0-9a-fA-F]\{6\}\).*/\1 \2/p'
    for i in $(sed -n "$<sub>SEDCMD</sub>" $HOME/.Xresources | awk '$1 < 16 {printf "\\e]P%X%s", $1, $2}'); do
        echo -en "$i"
    done
    clear
fi

However, this does not affect the tty font. If you dislike terminal-font (for example, number “1” and lowercase “l” are way too similar to my liking), then move on to…

Fix Number Two: Kmscon

Install the patched version of kmscon for a near-full colour effect. To enable kmscon on boot, follow instructions in Archwiki or whatever fits your distro and system better. Preferably, make conservative choices, i.e. do not enable kmscon across the board. Leave room for the system default tty.

After booting into kmscon, the font size can be zoomed in and out on the fly with simple Control plus and Control minus. Fine by me so far.

Caveats with Kmscon

In Kmscon, startx will result in error “Only console users are allowed to use X server.” To fix this, switch to a different tty and startx there, assuming you set up kmscon conservatively. My choice was eventually to put kmscon into tty2, so that the ordinary boot would end up in normal tty in tty1, which allows startx. I can switch to tty2 for kmscon if I happen to want that.

A major problem with the patched version of Kmson is that it does not allow configuration in /etc/kmscon/kmscon.conf the way the vanilla kmscon does. The patched version is configured upon compiling and I have not detected where to change it. Its terminal colours happen to more or less correspond to what I have set up in .Xresources, but they are not inherited from there, the font is something that misses many Latin-based and even more non-Latin glyphs etc. Either you like the patched version, you try configuring the vanilla, or you recompile with your own settings, I guess.

Final thoughts

Failure to provide easy and flexible tty configuration in modern Linux is a terrible omission. With all the feverish development going on in the graphical userspace, the non-graphical userspace is being neglected. All the text-based configuration that is possible with X, should also be possible without X!

Why not make it simple to apply e.g. one’s .Xresources? Why doesn’t it work to simply edit something like /etc/profile? Why is there no setting to convert cursor/point to a block and turn its blinking off globally and permanently? Why cannot I enable compose key on my keyboard where I want it?

What I am saying is that these questions should not exist. All that should be easily doable, obviously. I blame systemd that has messed up everything between kernel and userspace.

More reading

The story behind Kmscon – https://dvdhrm.wordpress.com/2012/08/11/kmscon-linux-kmsdrm-based-virtual-console/

Footnote

1 Source: https://forum.manjaro.org/t/how-to-change-tty-background-color/31384/2

Leave a Reply

Your email address will not be published. Required fields are marked *