legionus / kbd

Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/legion/kbd.git

Home Page:https://kbd-project.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it even possible to meet the condition for the establishment of a pure terminal?

Ricky-Tigg opened this issue · comments

Hello. This report would have been in its place in the dedicated Discussions section; the latter being disabled, I post here.

Text under the Introduction header at https://kbd-project.org/

The kbd project contains utilities for managing Linux console (Linux console, virtual terminals, keyboard, etc.).

Can you confirm that the above quote is indeed meant to express that the utilities provided by this program are not intended to be executed in an emulated terminal? Because I, despite all attempts to interpret it correctly, could not find any basis that could lead me to conclude in this way; notably virtual terminals.

I learned from one of your comments to one of my reports that the utilities were run on my system in a terminal emulator, and not in a pure terminal, in which these utilities are intended to operate. But what intrigued me, it's the fact that it exists reports here other than my own, therefore their authors must have been aware of some condition that had to be met in order to establish a pure terminal and so being able to execute those utilities according to their design. Yet I have no clue where they could have acquired such a knowledge by just reading the public documentation on the kbd-project.org site.

Can it be so, that the condition for a pure terminal is somehow related to the VT100, a hardware terminal, workstation that is of type Teletype (TTY)? If I understood correctly, could this hardware be called console, virtual terminal, as opposed to a pure terminal? Knowing that nowadays, a terminal qualified as emulator refers to a program that emulates the functionality of such a machine, can we conclude that this machine must have the ability to provide a pure terminal? Or is the achievement of a pure terminal tied to a special machine? Any suggestion would be welcome.

Can you confirm that the above quote is indeed meant to express that the utilities provided by this program are not intended to be executed in an emulated terminal?

Yes and no. You can use these utilities wherever you want (run from a terminal, a terminal emulator, or without a terminal at all). But you can only configure the terminal using them.

@Ricky-Tigg Tell me, what problem you want to solve by running these utilities ?

Still referring to ticket 114. I am testing these utilities in a desktop edition of a Linux distribution – thus a GUI DE – for the sole purpose of acquiring experience with these utilities. The targets in which I understood I would have use for them in a laptop computer are both desktop edition and server editions – thus a CLI environment, which is neither an X11 nor a Wayland compositor – so that keys pressed match the physical keyboard layout.

I understood I am using loadkeys as intended in order to set on-the-fly, thus in the current session, the virtual console (VC) Keymap for this purpose. Illustration in desktop edition of such a condition in terminal while reported tty are /dev/pts/2 and /dev/tty3:

$ localectl
System Locale: LANG=fi_FI.UTF-8
    VC Keymap: fi
   X11 Layout: fi
    X11 Model: pc105

@Ricky-Tigg Ok, to use loadkeys to configure /dev/tty3 you need to reference it like that:

[root]$ loadkeys -C /dev/tty3 fi

for example. You need to do it as a root because only superuser can configure such things. After that command user on that terminal (/dev/tty3) will see the changes. Before that depending on the keymap, you may need to set the terminal to unicode mode.

[root]$ kbd_mode -C /dev/tty3 --unicode

But I want to warn you, if you do not understand what you are doing, then there is a chance of making the keyboard unusable.

$ sudo kbd_mode
$ The keyboard is in Unicode (UTF-8) mode

The keyboard is by default in Unicode. I left it as such. sudo loadkeys -C /dev/tty3 fi works as intended. That was worth warning me, though if happening, the effect would have last as long as the session, thus would have ended by logging out. My next task will be to set the font case.

sudo loadkeys -C /dev/tty3 fi works as intended. That was worth warning me, though if happening, the effect would have last as long as the session, thus would have ended by logging out.

Wrong. The terminal configuration is saved between logins until the system is rebooted.

Your changes were overridden by your linux distribution. I can suggest that your distribution uses systemd and then you need to configure the console (keymap and font) through the /etc/vconsole.conf config.

My next task will be to set the font case.

man vconsole.conf
  • Wrong indeed. Am I forgetting, I was referring to a tty session as /dev/pts/, so a GUI terminal, which is not supported by these utilities.
  • Fedora is running – so yes , systemd.

Something intrigues me.

  • loadkeys -C /dev/tty3 us works as intended.
  • After that, localectl keeps on printing as follows:
$ localectl
System Locale: LANG=fi_FI.UTF-8
    VC Keymap: fi
   X11 Layout: fi
    X11 Model: pc105

Is it expected that VC Keymap remains unchanged as fi, so does not change to us?

A correction or clarification may be needed: my next task is to set permanently the font size in terminal whose tty is /dev/tty3. Is that governed by the /etc/vconsole.conf file?

$ localectl
System Locale: LANG=fi_FI.UTF-8
    VC Keymap: fi
   X11 Layout: fi
    X11 Model: pc105

Is it expected that VC Keymap remains unchanged as fi, so does not change to us?

The localectl shows the current configuration but not what you have loaded into the kernel. kbd utilities work at a lower level. systemd uses kbd utilities to configure the console.

Is that governed by the /etc/vconsole.conf file?

@Ricky-Tigg Yes, use it.

I feel that I am on the right track thanks to you.