Deutsch | English

Terminal emulators & system consoles using the library TSM. From a Wayland-compatible terminal emulator to the virtual console in Chromebooks.


Table of contents


TSM – Terminal Emulator State Machine

The library TSM is solely responsible for the pure terminal emulation, without being bound to a graphics library ⁽¹⁾. The last commit took place in 2014 and added a GTK widget to create a terminal emulator ⁽²⁾. An active fork can be found here ⁽³⁾, new features are listed in the ReadMe.

  1. Freedesktop.org: Wiki: Software → libtsm → »libtsm - Terminal-emulator State Machine«
  2. Freedesktop.org: cgit → dvdhrm/libtsm: »Terminal-Emulator State Machine« → commit: »gtktsm: add libtsm example«
    Date: 2014-04-24 | Commit: David Herrmann
  3. GitHub: Aetf/libtsm → »Terminal-emulator State Machine«

wlterm

wlterm

wlterm is the only terminal emulator used with the TSM library.

The wayland-devel mailing list contains a post by the developer David Herrmann about the terminal emulator wlterm, which sheds light on the technical background ⁽¹⁾.

This includes the previous lack of a terminal emulator for Wayland to find bugs in the Wayland API. The hint that decorations are drawn by wlterm itself is also interesting. This touches the topic client-side decorations under Wayland once again, which was mentioned in the two previous articles on Sway and terminal emulators ⁽²⁾ ⁽³⁾.

Furthermore, wlterm uses the library TSM for test purposes, which does not use GTK or similar dependencies and is not responsible for the rendering. The overview page for wlterm shows that originally there were no dependencies on graphics toolkits such as GTK or Qt ⁽⁴⁾ - which later changed with an extension for GTK.

One commit for the removal of the wlterm sources in the git repo including a brief rationale and reference to a GTK-based variant ⁽⁵⁾. The very last commit for the GTK-based version of wlterm has been going back a while ⁽⁶⁾. In the Arch User Repository we find wlterm orphaned, including GTK dependencies ⁽⁷⁾.

What remains is that wlterm could be used as the first native Wayland terminal client that did not rely on the VTE library.

  1. LWN.net: »wlterm: the native Wayland terminal emulator«
    Posted: 2012-09-27 | Developer: David Herrmann | Original Post: Mailinglist wayland-devel
  2. Blog: »semantic design« → »Tiling window manager under Wayland: Sway« → »Client-side decorations versus server-side decorations«
    Published: 2019-06-24 | Author: Markus Richter
  3. Blog: »semantic design« → »Terminal emulators: Windows into the system« → »Tilix«
    Published: 2019-09-30 | Author: Markus Richter
  4. Freedesktop.org: Wiki: Software → kmscon → »wlterm«
  5. GitHub: dvdhrm/wlterm → Commit: »wlterm: remove«
    Commit: 2013-10-23 | Developer: David Herrmann
  6. Freedesktop.org: cgit → dvdhrm/wlterm → »Summary«
    Commit: 2013-11-12 | Developer: David Herrmann
  7. ArchLinux: User Repository: Packages → »wlterm-git«
    Last Updated: 2016-06-21

Kmscon

Kmscon

libtsm works without a display server and was therefore developed. Kmscon uses this library and can thus replace the virtual console under Linux systems ⁽¹⁾.

The FAQ contains a short summary of the reasons for changing the console ⁽²⁾, as well as a detailed article by the developer ⁽³⁾. Associated therewith appeared an article that referred more to the previous implementation in the form of virtual consoles and the associated problems ⁽⁴⁾. Another article as compressed introduction to Kmscon ⁽⁵⁾.

In the first article of this three-part series by Red Hat on concepts of virtual machines and containers, user space and kernel space are explained as an abstract model ⁽⁶⁾.

The Debian manual splits up the user space,

  • by means of the connection between processes & daemons
  • and an explanation of how they communicate with each other and with the kernel,
  • as well as the role of some libraries in it ⁽⁷⁾.

The Arch Linux wiki shows how to set up Kmscon on the virtual terminals ⁽⁸⁾. Kmscon is used in combination with KMS (kernel mode-setting) ⁽⁹⁾, this Wikipedia article breaks down mode setting a bit ⁽¹⁰⁾.The Direct Rendering Manager (DRM) grants accesses to the memory of the graphics card and manages these ⁽¹¹⁾.

The latest version of libtsm used for Kmscon is from 2013 and can be found here ⁽¹²⁾, in this one the GTK-based terminal widget GtkTsmTerminal was added to create terminal emulators. The final commit to Kmscon took place in July 2014 ⁽¹³⁾.

A fork from Kmscon can be found on GitHub, which has continuous commits until September 2018 ⁽¹⁴⁾. Also, libtsm is maintained here as a Fork.

  1. Freedesktop.org: Wiki: Software → kmscon → »KMS/DRM based System Console«
  2. GitHub: dvdhrm/kmscon → Wiki: FAQ
  3. Blog: »Ponyhof – Disfunctional Programming« → »KMSCON: Linux KMS/DRM based Virtual Console«
    Date: 2012-08-11 | Author: David Herrmann
  4. Blog: »Ponyhof – Disfunctional Programming« → »Deprecating CONFIG_VT«
    Date: 2012-08-12 | Author: David Herrmann
  5. Blog: »Ponyhof – Disfunctional Programming« → »KMSCON Introduction«
    Date: 2012-12-10 | Author: David Herrmann
  6. Blog: RedHat: »Architecting Containers Part 1: Why Understanding User Space vs. Kernel Space Matters«
    Published: 2015-07-29 | Author: Scott McCarty
  7. The Debian Administrator's Handbook: »B.5. The User Space«
  8. ArchLinux: Wiki → »KMSCON«
  9. ArchLinux: Wiki → »Kernel mode setting«
  10. Wikipedia: »Mode-Setting«
  11. Wikipedia: »Direct Rendering Manager«
  12. Freedesktop.org: Software → kmscon: Releases
  13. GitHub: dvdhrm/kmscon → Commits
  14. GitHub: Aetf/kmscon → Commits

Frecon

What else happened to Kmscon and libtsm? There is a note in the developer mailing list of Kmscon ⁽¹⁾ ⁽²⁾. Google uses ChromiumOS ⁽³⁾ in a modified form as ChromeOS in its devices called Chromebooks ⁽⁴⁾. Google replaced the display server X11 in its own graphics stack called Freon. ⁽⁵⁾. Within the graphics stack Freon there is no display server, but the Chrome browser (which is the only application of the system) communicates directly via KMS.

Congenially, we find some information about Frecon as a virtual console in user space. Frecon also uses KMS and relies on libtsm. A short announcement on Google+ about switching to Freon / Frecon ⁽⁶⁾. An introduction to Frecon ⁽⁷⁾ and usable commands ⁽⁸⁾.

  1. Freedesktop.org: Mailinglists → kmscon-devel → »what is the development status of kmscon«
    Date: 2017-11-29
  2. Freedesktop.org: Mailinglists → kmscon-devel → Reply: »what is the development status of kmscon«
    Date: 2017-11-29
  3. »The Chromium Projects« → »Chromium OS«
  4. Google: Chromebook
  5. tuicool.org (original article from Phoronix) → »Chrome OS Switches To "Freon" Graphics Stack To Replace X11«
    Date: 2015-03-09 | Author: Michael Larabel
  6. Google+ → »… in a nutshell, project ozone¹/freon is Chrome OS without X server«
    Date: 2015-03-04 | Posted by: Francois Beaufort
  7. GoogleSource → Chromium: ChromiumOS: Frecon → »Frecon, a console for freon« → »Docs«
  8. GoogleSource → Chromium: ChromiumOS: Frecon → »frecon: the Freon Console« → »Commands«

Creative Commons License
This article is licensed under a
Creative Commons Attribution-ShareAlike 4.0 International License.