Code Monkey home page Code Monkey logo

kmscon's Introduction

KMSCON

Kmscon is a simple terminal emulator based on linux kernel mode setting (KMS). It is an attempt to replace the in-kernel VT implementation with a userspace console. See kmscon(1) man-page for usage information.

Requirements

Kmscon requires the following software:

  • libtsm: terminal emulator state machine
  • libudev: providing input, video, etc. device hotplug support (>=v172)
  • libxkbcommon: providing internationalized keyboard handling
  • libdrm: graphics access to DRM/KMS subsystem
  • linux-headers: linux kernel headers for ABI definitions

Everything else is optional:

For video output at least one of the following is required:

  • fbdev: For framebuffer video output the kernel headers must be installed and located in the default include path.
  • DRM: For unaccelerated drm output the "libdrm" library must be installed and accessible via pkg-config.
  • OpenGLES2: For accelerated video output via OpenGLESv2 the following must be installed: libdrm, libgbm, egl, glesv2 (i.e., mesa)

For font handling the following is required:

  • 8x16: The 8x16 font is a static built-in font which does not require external dependencies.
  • unifont: Static font without external dependencies.
  • pango: drawing text with pango Pango requires: glib, pango, fontconfig, freetype2 and more

For multi-seat support you need the following packages:

  • systemd: Actually only the systemd-logind daemon and library is required.

Download

Released tarballs can be found at: https://github.com/Aetf/kmscon/releases

Install

To compile the kmscon binary, run the standard meson commands:

meson builddir/

By default this will install into /usr/local, you can change your prefix with --prefix=/usr (or meson configure builddir/ -Dprefix=/usr after the initial meson setup).

Then build and install. Note that this requires ninja.

meson -C builddir/ install

The following meson options are available. They can be used to select backends for several subsystems in kmscon. If build-time dependencies cannot be satisfied, an option is automatically turned off, except if you explicitly enable it via command line:

option default description
extra_debug false Additional debug outputs
multi_seat auto This requires the systemd-logind library to provide multi-seat support for kmscon
video_fbdev auto Linux fbdev video backend
video_drm2d auto Linux DRM software-rendering backend
video_drm3d auto Linux DRM hardware-rendering backend
font_unifont auto Static built-in non-scalable font (Unicode Unifont)
font_pango auto Pango based scalable font renderer
renderer_bbulk auto Simple 2D software-renderer (bulk-mode)
renderer_gltex auto OpenGLESv2 accelerated renderer
renderer_pixman auto pixman based renderer
session_dummy auto Dummy fallback session
session_terminal auto Terminal-emulator sessions

Running

To get usage information, run:

kmscon --help

You can then run kmscon with:

kmscon [options]

Locale

Kmscon queries and setups system locale settings before starting if systemd-localed is available. Otherwise, you can change locale settings via --xkb-{model,layout,variant,options} command line options. See man kmscon for more information.

Config file

The default configuration file is /etc/kmscon/kmscon.conf. Any command line option can be put in the config file in its long form without the leading -- (double dash). See man kmscon for more information.

License

This software is licensed under the terms of an MIT-like license. Please see COPYING for further information.

History

This is a personal fork from https://www.freedesktop.org/wiki/Software/kmscon, which hasn't been updated since 2014.

kmscon's People

Contributors

aetf avatar bluetech avatar cl91 avatar danshapero avatar falconindy avatar jwilk avatar keszybz avatar lkundrak avatar mmonaco avatar mslusarz avatar pwnissan avatar soreau avatar subtervisor avatar tedkotz avatar thierryreding avatar viccie30 avatar vogtinator avatar winspool avatar ysangkok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kmscon's Issues

Still multiple issues with multi-head

There are at least two issues with multi-head support as far as I've tested.

  1. Different resolution, different dot pitch: It would be nice to support font sizes per display.
  2. Sometimes the KMSCON does not get initialized or restored on one output, which then proceeds to display the default TTY, with no agetty running on it, so keyboard output just spills out on that screen, including passwords typed into KMSCON.

Font is not properly rendered yet

I've tried this fork (Installing the AUR package) because I was checking the issues in the main kmscon repo and I see that one which suggest this fork could fix that bad rendered width for fonts but they are still cut in a half. That's my /etc/kmscon/kmscon.conf

# config file for kmscon linux console
xkb-layout=es
#xkb-variant=neo
font-name=DejaVuSansMono Nerd Font
font-size=10
hwaccel

photo_2019-12-07_00-37-58

Another question is that I'm not getting the terminal in a full size filling all the screen, I'd thought this might be because my laptop PC has a integrated display more little than my desktop display, but it is also happening in my desktop PC. So I guess I must setup the resolution in some way.

photo_2019-12-07_00-38-03

Use localed to get default XKB settings

Currently when starting "kmscon" without configuration, the keyboard layout is always "us" and can't be switched during runtime.

A more sensible default would be to query localed for the system wide settings, if available.

Example wrapper script using dbus-send:

#!/bin/sh
# Get a property value from org.freedesktop.locale1
queryLocale1() {
    dbus-send --system --print-reply=literal --dest=org.freedesktop.locale1 /org/freedesktop/locale1 org.freedesktop.DBus.Properties.Get "string:org.freedesktop.locale1" "string:$1" | awk '{print $2}'
}

# Query whether org.freedesktop.locale1 is available. If it is, try to
# set XKB_DEFAULT_{MODEL,LAYOUT,VARIANT,OPTIONS} accordingly.
if queryLocale1 X11Model >/dev/null 2>/dev/null; then
    # Do not overwrite existing values. There is no point in setting only some
    # of them as then they would not match anymore.
    if [ -z "${XKB_DEFAULT_MODEL}" -a -z "${XKB_DEFAULT_LAYOUT}" -a \
         -z "${XKB_DEFAULT_VARIANT}" -a -z "${XKB_DEFAULT_OPTIONS}" ]; then
        X11MODEL="$(queryLocale1 X11Model)"
        X11LAYOUT="$(queryLocale1 X11Layout)"
        X11VARIANT="$(queryLocale1 X11Variant)"
        X11OPTIONS="$(queryLocale1 X11Options)"
        [ -n "${X11MODEL}" ] && export XKB_DEFAULT_MODEL="${X11MODEL}"
        [ -n "${X11LAYOUT}" ] && export XKB_DEFAULT_LAYOUT="${X11LAYOUT}"
        [ -n "${X11VARIANT}" ] && export XKB_DEFAULT_VARIANT="${X11VARIANT}"
        [ -n "${X11OPTIONS}" ] && export XKB_DEFAULT_OPTIONS="${X11OPTIONS}"
    fi
fi

kmscon "$@"

Line height has extra padding

Take the Mx437 Verite 8x16 font from int10h.org (or a distro package of the same, e.g. int10h-oldschoolpc-fonts). Using kmscon-9.0.0, kmscon --font-name "Mx437 Verite 8x16" --font-size=24, I run the Midnight Commander (mc), which produces the following display output, with gaps between the individual lines, where the line-drawing graphics are chopped up.

gaps

This would not happen in xterm or xfce4-terminal.

INSTALL: Cannot find shared object file libtsm.so.4

I downloaded and installaed libtsm 4 from https://github.com/Aetf/libtsm via the following but kmscon doesn't see to find it:

$ git clone https://github.com/Aetf/libtsm
$ cd libstsm
$ test -f ./configure || NOCONFIGURE=1 ./autogen.sh
$ ./configure
$ make
$ make install

OS:
Ubuntu Server 18.04

ERROR:

$ kmscon

/usr/local/libexec/kmscon/kmscon: error while loading shared libraries: libtsm.so.4: cannot open shared object file: No such file or directory

NOTES:

$ ls /usr/local/lib

kmscon
libtsm.a
libtsm.la
libtsm.so
libtsm.so.4
libtsm.so.4.0.0
node_modules
pkgconfig
python2.7
python3.6

Implement proper unit testing

I can get tests to pass on a snapshot from just before the meson conversion, but I cannot get them to pass on meson. Wondering if they pass for anyone else.

Log of Meson test suite run on 2022-07-01T10:06:08.295489

Inherited environment: SHELL=/bin/bash XDG_CONFIG_DIRS=/etc/xdg LESS='-R -M --shift 5' CONFIG_PROTECT_MASK='/etc/sandbox.d /etc/fonts/fonts.conf /etc/gentoo-release /etc/gconf /etc/terminfo /etc/dconf /etc/ca-certificates.conf /etc/revdep-rebuild' EDITOR=/usr/bin/vi PWD=/root CONFIG_PROTECT='/usr/share/gnupg/qualified.txt /usr/lib64/libreoffice/program/sofficerc' LOGNAME=root MANPATH=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.3.0/man:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.38/man:/usr/local/share/man:/usr/share/man:/usr/lib/rust/man:/usr/lib/llvm/14/share/man XAUTHORITY=/root/.xauthDSkeeT OPENCL_PROFILE=mesa HOME=/root LANG=en_US.utf8 LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.zst=01;31:.tzst=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.wim=01;31:.swm=01;31:.dwm=01;31:.esd=01;31:.avif=01;35:.jpg=01;35:.jpeg=01;35:.mjpg=01;35:.mjpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.webp=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.cfg=00;32:.conf=00;32:.diff=00;32:.doc=00;32:.ini=00;32:.log=00;32:.patch=00;32:.pdf=00;32:.ps=00;32:.tex=00;32:.txt=00;32:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.oga=00;36:.opus=00;36:.spx=00;36:.xspf=00;36:~=00;90:#=00;90:.bak=00;90:.old=00;90:.orig=00;90:.part=00;90:.rej=00;90:.swp=00;90:.tmp=00;90:.dpkg-dist=00;90:.dpkg-old=00;90:.ucf-dist=00;90:.ucf-new=00;90:.ucf-old=00;90:.rpmnew=00;90:.rpmorig=00;90:*.rpmsave=00;90:' FLTK_DOCDIR=/usr/share/doc/fltk-1.3.5-r4/html OPENGL_PROFILE=xorg-x11 INFOPATH=/usr/share/gcc-data/x86_64-pc-linux-gnu/11.3.0/info:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.38/info:/usr/share/info MOZ_GMP_PATH=/usr/lib64/nsbrowser/plugins/gmp-gmpopenh264/system-installed TERM=xterm-256color LESSOPEN='|lesspipe %s' USER=root MANPAGER=manpager DISPLAY=:0 SHLVL=1 PAGER=/usr/bin/less GCC_SPECS='' GSETTINGS_BACKEND=dconf XDG_DATA_DIRS=/usr/local/share:/usr/share:/usr/share/gdm PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin _=/usr/bin/meson

1/4 test_output FAIL 0.01s exit status 13
15:06:08 MALLOC_PERTURB_=112 /var/tmp/portage/sys-apps/kmscon-9.0.0/work/kmscon-9.0.0-build/tests/test_output
----------------------------------- output -----------------------------------
stderr:
[0000.000000] NOTICE: /var/tmp/portage/sys-apps/kmscon-9.0.0/work/kmscon-9.0.0-build/tests/test_output Revision v9.0.0 Jul 1 2022 09:55:44 (log_print_init() in ../kmscon-9.0.0/src/shl_log.c:509)
[0000.000025] NOTICE: Creating video object using /dev/dri/card0... (main() in ../kmscon-9.0.0/tests/test_output.c:216)
[0000.007446] NOTICE: Wakeing up video object... (main() in ../kmscon-9.0.0/tests/test_output.c:231)
[0000.007456] ERROR: drm_shared: cannot set DRM-master (uterm_drm_video_wake_up() in ../kmscon-9.0.0/src/uterm_drm_shared.c:738)
[0000.008312] ERROR: init failed, errno -13: Permission denied (test_fail() in ../kmscon-9.0.0/tests/test_include.h:144)

2/4 test_key TIMEOUT 30.01s killed by signal 15 SIGTERM
15:06:08 MALLOC_PERTURB_=175 /var/tmp/portage/sys-apps/kmscon-9.0.0/work/kmscon-9.0.0-build/tests/test_key
----------------------------------- output -----------------------------------
stderr:
Quit with 'q' (maybe followed by 'enter'/'return')^M
Maybe your terminal may be unusable after this, use 'reset' to fix it^M

3/4 test_vt TIMEOUT 30.01s
15:06:08 MALLOC_PERTURB_=38 /var/tmp/portage/sys-apps/kmscon-9.0.0/work/kmscon-9.0.0-build/tests/test_vt
----------------------------------- output -----------------------------------
stderr:
[0000.000000] NOTICE: /var/tmp/portage/sys-apps/kmscon-9.0.0/work/kmscon-9.0.0-build/tests/test_vt Revision v9.0.0 Jul 1 2022 09:55:44 (log_print_init() in ../kmscon-9.0.0/src/shl_log.c:509)
[0000.004164] NOTICE: vt: using tty /dev/tty7 (open_tty() in ../kmscon-9.0.0/src/uterm_vt.c:285)

4/4 test_input TIMEOUT 30.03s
15:06:08 MALLOC_PERTURB_=143 /var/tmp/portage/sys-apps/kmscon-9.0.0/work/kmscon-9.0.0-build/tests/test_input
----------------------------------- output -----------------------------------
stderr:
[0000.000000] NOTICE: /var/tmp/portage/sys-apps/kmscon-9.0.0/work/kmscon-9.0.0-build/tests/test_input Revision v9.0.0 Jul 1 2022 09:55:44 (log_print_init() in ../kmscon-9.0.0/src/shl_log.c:509)

Summary of Failures:

1/4 test_output FAIL 0.01s exit status 13
2/4 test_key TIMEOUT 30.01s killed by signal 15 SIGTERM
3/4 test_vt TIMEOUT 30.01s
4/4 test_input TIMEOUT 30.03s

Ok: 0
Expected Fail: 0
Fail: 1
Unexpected Pass: 0
Skipped: 0
Timeout: 3

Compilation link error :undefined reference to `drmxxx' functions of lindrm.so.2

Ubuntn 21.10 : libdrm.so.2.4.107

make V=99
libtool: link: gcc -D_GLIBCXX_USE_CXX11_ABI=0 -Wall -pipe -fno-common -ffast-math -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -ffunction-sections -fdata-sections -fstack-protector -g -O2 -g -O2 -Wl,--as-needed -Wl,--gc-sections -Wl,-z -Wl,relro -Wl,-z -Wl,now -rdynamic -o kmscon src/kmscon-conf.o src/kmscon-pty.o src/kmscon-font.o src/kmscon-font_8x16.o src/kmscon-text.o src/kmscon-text_bblit.o src/kmscon-kmscon_module.o src/kmscon-kmscon_seat.o src/kmscon-kmscon_conf.o src/kmscon-kmscon_main.o src/kmscon-kmscon_dummy.o src/kmscon-kmscon_terminal.o /usr/lib/x86_64-linux-gnu/libdrm.so.2  -L/usr/local/lib /usr/local/lib/libtsm.so ./.libs/libeloop.a ./.libs/libuterm.a -ludev -lsystemd ./.libs/libshl.a -lxkbcommon -lGLESv2 -lpthread -ldl -pthread
/usr/bin/ld: ./.libs/libuterm.a(libuterm_la-uterm_video.o): in function `video_drm_available':
/mnt/g/linux/Aetfkmscon/src/uterm_video_internal.h:189: undefined reference to `drmAvailable'
/usr/bin/ld: ./.libs/libuterm.a(libuterm_la-uterm_drm2d_video.o): in function `video_init':
/mnt/g/linux/Aetfkmscon/src/uterm_drm2d_video.c:333: undefined reference to `drmGetCap'
/usr/bin/ld: ./.libs/libuterm.a(libuterm_la-uterm_drm2d_video.o): in function `init_rb':
/mnt/g/linux/Aetfkmscon/src/uterm_drm2d_video.c:90: undefined reference to `drmIoctl'
/usr/bin/ld: /mnt/g/linux/Aetfkmscon/src/uterm_drm2d_video.c:100: undefined reference to `drmModeAddFB'
/usr/bin/ld: /mnt/g/linux/Aetfkmscon/src/uterm_drm2d_video.c:111: undefined reference to `drmIoctl'
/usr/bin/ld: /mnt/g/linux/Aetfkmscon/src/uterm_drm2d_video.c:130: undefined reference to `drmModeRmFB'
............
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:1476:kmscon] 错误 1
make[1]: *** [Makefile:2215:all-recursive] 错误 1
make: *** [Makefile:1148:all] 错误 2

libdrm.so.2 API link error?! undefined reference to xxxxxx ,Why?

-D_GLIBCXX_USE_CXX11_ABI=0 is Option

Bad rendering of font width and incomplete rendering of glyphs with pango font engine

Hi,
I'm trying to use this patched version of kmscon alongside the patched libtsm.
I'm no expert at all in this area so correct me if I write anything that doesn't make sense.
I'm testing different CLI options, for example if I run as root kmscon --vt=tty4 --no-switchvt --debug --font-name="FiraMono Nerd Font" --font-engine=pango I get the following result

PXL_20220820_195127592 MP

And this is the log

[0000.000000] NOTICE: kmscon Revision v9.0.0-10-g20a2fc4 Aug 20 2022 21:06:55 (log_print_init() in ../src/shl_log.c:509)
[0000.003580] INFO: systemd: system booted with systemd, enabling multi-seat support (uterm_sd_new() in ../src/uterm_systemd.c:67)
[0000.009567] NOTICE: vt: using tty /dev/tty4 (open_tty() in ../src/uterm_vt.c:285)
[0000.062376] INFO: drm_shared: new drm device via /dev/dri/card1 (uterm_drm_video_init() in ../src/uterm_drm_shared.c:501)
[0000.062447] INFO: video: new device 0x1a4d210 (uterm_video_new() in ../src/uterm_video.c:576)
[0000.062867] INFO: ignoring video device /dev/fb0 on seat seat0 as it is a DRM-fbdev device (app_seat_gpu_is_ignored() in ../src/kmscon_main.c:287)
[0000.162271] INFO: drm_shared: new drm device via /dev/dri/card0 (uterm_drm_video_init() in ../src/uterm_drm_shared.c:501)
[0000.162302] INFO: video: new device 0x1a4d060 (uterm_video_new() in ../src/uterm_video.c:576)
[0001.936820] INFO: video: new display 0x1a4ef40 (display_new() in ../src/uterm_video.c:235)
[0001.936852] INFO: drm_shared: display 0x1a4ef40 DPMS is ON (bind_display() in ../src/uterm_drm_shared.c:632)
[0002.003164] INFO: video: new display 0x1a37210 (display_new() in ../src/uterm_video.c:235)
[0002.003187] INFO: drm_shared: display 0x1a37210 DPMS is ON (bind_display() in ../src/uterm_drm_shared.c:632)
[0002.106064] INFO: video_drm2d: activating display 0x1a37210 to 2560x1440 (display_activate() in ../src/uterm_drm2d_video.c:172)
[0002.233852] INFO: drm_shared: setting DPMS of display 0x1a37210 to ON (uterm_drm_display_set_dpms() in ../src/uterm_drm_shared.c:295)
[0002.300846] INFO: video_drm2d: activating display 0x1a4ef40 to 1440x900 (display_activate() in ../src/uterm_drm2d_video.c:172)
[0002.570490] INFO: drm_shared: setting DPMS of display 0x1a4ef40 to ON (uterm_drm_display_set_dpms() in ../src/uterm_drm_shared.c:295)

The kernel is

uname -r
5.18.17-200.fc36.x86_64

The monitor is connected to a Nvidia GPU and the graphical drivers on the system are i915 and nouveau

inxi -G
Graphics:
  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics
    driver: i915 v: kernel
  Device-2: NVIDIA TU106 [GeForce RTX 2060 SUPER] driver: nouveau v: kernel
  Display: x11 server: X.Org v: 1.20.14 with: Xwayland v: 22.1.3 driver: X:
    loaded: modesetting unloaded: fbdev,vesa gpu: nouveau resolution:
    1: 1440x900~60Hz 2: 2560x1440~60Hz
  OpenGL: renderer: NV166 v: 4.3 Mesa 22.1.6

Compilation error on Arch

I'm trying to install kmscon on Arch, i've already downloaded libtsm 4.0 from AUR and i'm stuck on the make step, the compilation fails with the following error message:

src/text_bblit.c: In function 'bblit_draw':
src/text_bblit.c:87:17: error: 'const struct tsm_screen_attr' has no member named 'italic'
    87 |                   if (attr->italic)
       |                           ^~
make[2]: *** [Makefile:1902: src/kmscon-text_bblit.o] Error 1
make[1]: *** [Makefile:2214: all-recursive] Error 1
make: *** [Makefile:1147: all] Error 2

Any help would be immensely appreciated

Just a quick question, i'm trying your fork because of dvdhrm#133 (comment), i tried the @dvdhrm repo, but i had the same problem from this thread, the icons are cropped for me as well, does your fork solves this issue?

Blinking cursor

Hello. Thank you for maintaining kmscon. I would like to know if there is a way to use blinking cursor.
Did not find anything in the docs. Thank you.

Requires unreleased libtsm 4.0.0

Upon attempting to install, it told me I needed libtsm >=v4.0.0 or newer. I changed PKG_CONFIG_PATH to /usr/local/bin/pkgconfig, otherwise it wouldn't detect libtsm at all.
Outputted log:

~/Downloads/kmscon-develop# ./configure
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
libtoolize: linking file 'build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: linking file 'm4/libtool.m4'
libtoolize: linking file 'm4/ltoptions.m4'
libtoolize: linking file 'm4/ltsugar.m4'
libtoolize: linking file 'm4/ltversion.m4'
libtoolize: linking file 'm4/lt~obsolete.m4'
configure.ac:36: installing 'build-aux/ar-lib'
configure.ac:17: installing 'build-aux/compile'
configure.ac:19: installing 'build-aux/config.guess'
configure.ac:19: installing 'build-aux/config.sub'
configure.ac:21: installing 'build-aux/install-sh'
configure.ac:21: installing 'build-aux/missing'
Makefile.am: installing 'build-aux/depcomp'
[root@stone-BOAMOT-481 kmscon-develop]# ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking dependency style of gcc... gcc3
checking whether make supports nested variables... (cached) yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking for gcc... gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking how to run the C preprocessor... gcc -E
checking for gcc option to accept ISO C99... none needed
checking for ar... ar
checking the archiver (ar) interface... ar
checking for a sed that does not truncate output... /usr/bin/sed
checking whether ln -s works... yes
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for gawk... (cached) gawk
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for XKBCOMMON... yes
checking for TSM... no
configure: error: Package requirements (libtsm >= 4.0.0) were not met:

Package dependency requirement 'libtsm >= 4.0.0' could not be satisfied.
Package 'libtsm' has version '3', required version is '>= 4.0.0'

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables TSM_CFLAGS
and TSM_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Window manager crashes when pressing Ctrl+Shift+C

I installed kmscon and enabled it via [email protected] - everything worked as expected.

But I ran into a strange issue where after logging into the kmscon console and launching a wayland window manager from the command line e.g. exec sway as I would normally do with the linux console via agetty - whenever I press Ctrl+Shift+C keys together the window manager seems to shut down or crash (screen becomes blank but I can still switch to another TTY).

The keys Ctrl+Shift+C are not mapped to anything in the window manager.

Initially I thought that maybe this sequence is bound to something inside the kmscon console e.g. grab-session-close but after setting all the grab shortcuts to empty values in the config file, it still behaves the same way.

My kmscon.conf configuration file looks like this:

font-name=Meslo LG S
font-size=26
xkb-repeat-rate=25
xkb-repeat-delay=200
xkb-model=pc104
xkb-layout=custom
xkb-variant=custom
no-drm
no-hwaccel
font-engine=pango
render-engine=bblit
grab-scroll-up=
grab-scroll-down=
grab-page-up=
grab-page-down=
grab-zoom-in=
grab-zoom-out=
grab-session-next=
grab-session-prev=
grab-session-dummy=
grab-session-close=
grab-terminal-new=

Could there be any other grab shortcuts that aren't listed?

Installation: Which headers to use, how to choose?

Hi. I've found this package as a potential solution to support vim with 256 colors by way of https://superuser.com/questions/67582/tty-with-256-colors.

I have a server running Ubuntu 18.04. I've followed the installation instructions and so far have found corresponding packages to satisfy the dependencies listed:

apt install -y libtsm-dev libudev-dev libxkbcommon-dev libdrm-dev

But attempting to install linux-headers returns a list of options, and I'm not sure what to choose:

Reading package lists...
Building dependency tree...
Reading state information...
Package linux-headers is a virtual package provided by:
  linux-headers-4.15.0-29-lowlatency 4.15.0-29.31
  linux-headers-4.15.0-29-generic 4.15.0-29.31
  linux-headers-4.15.0-24-lowlatency 4.15.0-24.26
  linux-headers-4.15.0-24-generic 4.15.0-24.26
  linux-headers-4.15.0-23-lowlatency 4.15.0-23.25
  linux-headers-4.15.0-23-generic 4.15.0-23.25
  linux-headers-4.15.0-22-lowlatency 4.15.0-22.24
  linux-headers-4.15.0-22-generic 4.15.0-22.24
  linux-headers-4.15.0-1018-azure 4.15.0-1018.18
  linux-headers-4.15.0-1016-kvm 4.15.0-1016.16
  linux-headers-4.15.0-1016-aws 4.15.0-1016.16
  linux-headers-4.15.0-1014-gcp 4.15.0-1014.14
  linux-headers-4.15.0-1014-azure 4.15.0-1014.14
  linux-headers-4.15.0-1013-azure 4.15.0-1013.13
  linux-headers-4.15.0-1012-oem 4.15.0-1012.15
  linux-headers-4.15.0-1012-kvm 4.15.0-1012.12
  linux-headers-4.15.0-1012-azure 4.15.0-1012.12
  linux-headers-4.15.0-1011-kvm 4.15.0-1011.11
  linux-headers-4.15.0-1011-aws 4.15.0-1011.11
  linux-headers-4.15.0-1010-kvm 4.15.0-1010.10
  linux-headers-4.15.0-1010-gcp 4.15.0-1010.10
  linux-headers-4.15.0-1010-aws 4.15.0-1010.10
  linux-headers-4.15.0-1009-oem 4.15.0-1009.12
  linux-headers-4.15.0-1009-gcp 4.15.0-1009.9
  linux-headers-4.15.0-1009-aws 4.15.0-1009.9
  linux-headers-4.15.0-1008-oem 4.15.0-1008.11
  linux-headers-4.15.0-1008-gcp 4.15.0-1008.8
  linux-headers-4.15.0-1006-oem 4.15.0-1006.9
  linux-headers-4.15.0-20-lowlatency 4.15.0-20.21
  linux-headers-4.15.0-20-generic 4.15.0-20.21
  linux-headers-4.15.0-1009-azure 4.15.0-1009.9
  linux-headers-4.15.0-1008-kvm 4.15.0-1008.8
  linux-headers-4.15.0-1007-aws 4.15.0-1007.7
  linux-headers-4.15.0-1006-gcp 4.15.0-1006.6
  linux-headers-4.15.0-1004-oem 4.15.0-1004.5

Can't use backspace & CTRL+backspace as intended

I have an issue when using this KMSCON.
After login, when I press backspace, it send ^H, meaning it delete 1 word, not 1 character. Tried Ctrl+backspace, it still sends ^H.

❯ showkey -a

Press any keys - Ctrl-D will terminate this program

^H        8 0010 0x08   # actually pressing only backspace
^H        8 0010 0x08   # pressing ctrl+backspace
^D        4 0004 0x04

My shell is ZSH. Let me know if you need more info. Thank you.

libdrm dependency

The dependency on libdrm is added twice in meson.build. Once unconditionally (

libdrm_deps = dependency('libdrm')
) and once conditioned on either video_drm2d or video_drm3d being enabled (

kmscon/meson.build

Lines 65 to 68 in 3292791

require_libdrm = get_option('video_drm2d').enabled() or get_option('video_drm3d').enabled()
libsystemd_deps = dependency('libsystemd', disabler: true, required: get_option('multi_seat'))
libdrm_deps = dependency('libdrm', disabler: true, required: require_libdrm)
). A few lines down (

kmscon/meson.build

Lines 93 to 94 in 3292791

'video_drm2d': [],
'video_drm3d': [gbm_deps, egl_deps, glesv2_deps],
) the requirement is checked for video_drm3d, but not for video_drm2d.

In 'src/meson.build' the dependency is added for both video_drm2d or video_drm3d again (

kmscon/src/meson.build

Lines 115 to 118 in 3292791

if enable_video_drm2d or enable_video_drm3d
uterm_srcs += 'uterm_drm_shared.c'
uterm_dep += libdrm_deps
endif
).

I don't know exactly what the dependency is supposed to be, but I think all four places need to be aligned.

Mouse support?

Is it perhaps possible that mouse support might be implemented using Consolation? Either taking some advantage of its codebase or creating whatever bridge might be necessary for it to work. I suggest Consolation rather than GPM because the former has a lot more support for hardware using libinput than GPM does.

If there's any semblance of the necessary support to be found, I'd be interested in helping with the glue. If I'm far off base and mouse support would have to be done from scratch, it's not a project I'd want to take on myself at the moment.

libsystemd-daemon -login detection in configure.ac

On some systems there is no libsystemd-daemon or libsystemd-login anymore so

-PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon libsystemd-login],
+PKG_CHECK_MODULES([SYSTEMD], [libsystemd],

Reason: deprecated

The older pkg_config files .pc can be included for backward compatibility in some newer distros but afaics point to newer libsystemd.

Source: 2014 Systemd 209 announce

Console screen is not updated, but kmscon is working

System: Arch up to date
Installed: kmscon-patched-git as of today 9.0.0.r10.g20a2fc4-1, libtsm-patched-git 4.0.2.r17.gd66dd16-1

Symptome: The console is working, but the output is only updated when I switch between consoles or console/X. I can log in and type commands, but the screen is only updated after console switch.

Custom palette support

Aetf/libtsm#19.

The support has in libtsm for a while, but it needs support from kmscon side to feed the palette to libtsm.

Some ways to do it

  • Include an option in kmscon.conf that defines the palette at start up
  • support the OSC sequence ESC ] P nrrggbb to set the RGB value of individual color in the palette, same as the linux console.

Way to specify bold font

Hi, I'm wondering if there's a way to specify font weight in the kmscon config or if this might be added. I tried e.g. Monospace Bold but this didn't do what I hoped it would. The average VTE GUI terminal has a bunch of knobs besides those. Not sure which ones are worth implementing and which aren't. Most people seem happy once they have font, size, and color schemes. In my case DPI too. In fact setting DPI was the only thing I had to set. using a bold font would just allow me to use a slightly smaller font comfortably.

File conflict on 32bit

Works fine on 64bit, which meant that it worked fine here.

The kmscon binary is installed as /usr/lib/kmscon, but the modules end up in /usr/lib/kmscon/. Having a file as a directory doesn't work...

I guess moving the binary to /usr/lib/kmscon/kmscon is the easiest fix.

[   65s] + make install DESTDIR=/home/abuild/rpmbuild/BUILDROOT/kmscon-8.1~1532533639-1.1.i386
[   65s] Making install in .
[   65s]  /usr/bin/mkdir -p '/home/abuild/rpmbuild/BUILDROOT/kmscon-8.1~1532533639-1.1.i386/usr/bin'
[   65s]  /usr/bin/install -c scripts/kmscon '/home/abuild/rpmbuild/BUILDROOT/kmscon-8.1~1532533639-1.1.i386/usr/bin'
[   65s]  /usr/bin/mkdir -p '/home/abuild/rpmbuild/BUILDROOT/kmscon-8.1~1532533639-1.1.i386/usr/lib'
[   65s]   /bin/sh ./libtool   --mode=install /usr/bin/install -c kmscon '/home/abuild/rpmbuild/BUILDROOT/kmscon-8.1~1532533639-1.1.i386/usr/lib'
[   65s] libtool: install: /usr/bin/install -c kmscon /home/abuild/rpmbuild/BUILDROOT/kmscon-8.1~1532533639-1.1.i386/usr/lib/kmscon
[   65s]  /usr/bin/mkdir -p '/home/abuild/rpmbuild/BUILDROOT/kmscon-8.1~1532533639-1.1.i386/usr/share/man/man1'
[   65s]  /usr/bin/install -c -m 644 docs/man/kmscon.1 '/home/abuild/rpmbuild/BUILDROOT/kmscon-8.1~1532533639-1.1.i386/usr/share/man/man1'
[   65s]  /usr/bin/mkdir -p '/home/abuild/rpmbuild/BUILDROOT/kmscon-8.1~1532533639-1.1.i386/usr/lib/kmscon'
[   65s] /usr/bin/mkdir: cannot create directory '/home/abuild/rpmbuild/BUILDROOT/kmscon-8.1~1532533639-1.1.i386/usr/lib/kmscon': File exists
[   65s] make[2]: *** [Makefile:1352: install-moduleLTLIBRARIES] Error 1
[   65s] make[1]: *** [Makefile:2567: install-am] Error 2
[   65s] make: *** [Makefile:2260: install-recursive] Error 1

Update README to point to Aetf/libtsm as the dependency

The latest version of libtsm is 3, see: https://cgit.freedesktop.org/~dvdhrm/libtsm/commit/?id=e998bb280049ccd477b50a35718abdb46ab6a9fc

However, configuration says:

configure: error: Package requirements (libtsm >= 4.0.0) were not met:

Requested 'libtsm >= 4.0.0' but version of libtsm is 3
You may find new versions of libtsm at http://dvdhrm.github.io/libtsm

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables TSM_CFLAGS
and TSM_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Can antialiasing be disabled with pango?

I got pretty good result with

font-engine=pango
font-name=Terminus, WenQuanYi Micro Hei Mono
font-size=12
font-dpi=192

However since Terminus is a bitmap font, it would look much better if we could disable anti-aliasing.
Does anybody knows how?

Function not implemented (display_activate() in ../kmscon-9.0.0/src/uterm_drm3d_video.c:171)

This is what I get when I try to use kmscon:

Feb 28 13:01:02 berbelek kmscon[3538]: [0000.000000] NOTICE: kmscon Revision v9.0.0 Feb 28 2024 11:45:18 (log_print_init() in ../kmscon-9.0.0/src/shl_log.c:509)
Feb 28 13:01:02 berbelek kmscon[3538]: [0000.000011] INFO: conf: reading config file /etc/kmscon/kmscon.conf (conf_parse_file() in ../kmscon-9.0.0/src/conf.c:547)
Feb 28 13:01:02 berbelek kmscon[3538]: [0000.002685] INFO: systemd: system booted with systemd, enabling multi-seat support (uterm_sd_new() in ../kmscon-9.0.0/src/uterm_systemd.c:67)
Feb 28 13:01:02 berbelek kmscon[3538]: [0000.006661] NOTICE: vt: using tty /dev/tty4 (open_tty() in ../kmscon-9.0.0/src/uterm_vt.c:285)
Feb 28 13:01:02 berbelek kmscon[3538]: [0000.099089] INFO: drm_shared: new drm device via /dev/dri/card0 (uterm_drm_video_init() in ../kmscon-9.0.0/src/uterm_drm_shared.c:501)
Feb 28 13:01:02 berbelek kmscon[3538]: [0000.125010] INFO: video: new device 0x5e96764818b0 (uterm_video_new() in ../kmscon-9.0.0/src/uterm_video.c:576)
Feb 28 13:01:02 berbelek kmscon[3538]: [0000.125440] INFO: ignoring video device /dev/fb0 on seat seat0 as it is a DRM-fbdev device (app_seat_gpu_is_ignored() in ../kmscon-9.0.0/src/kmscon_main.c:287)
Feb 28 13:01:06 berbelek kmscon[3538]: [0003.842314] INFO: video: new display 0x5e967647ab20 (display_new() in ../kmscon-9.0.0/src/uterm_video.c:235)
Feb 28 13:01:06 berbelek kmscon[3538]: [0003.842335] INFO: drm_shared: display 0x5e967647ab20 DPMS is ON (bind_display() in ../kmscon-9.0.0/src/uterm_drm_shared.c:632)
Feb 28 13:01:06 berbelek kmscon[3538]: [0003.844045] INFO: video: new display 0x5e96764cb670 (display_new() in ../kmscon-9.0.0/src/uterm_video.c:235)
Feb 28 13:01:06 berbelek kmscon[3538]: [0003.844061] INFO: drm_shared: display 0x5e96764cb670 DPMS is ON (bind_display() in ../kmscon-9.0.0/src/uterm_drm_shared.c:632)
Feb 28 13:01:06 berbelek kmscon[3538]: [0003.844259] INFO: uterm_drm3d_video: activating display 0x5e96764cb670 to 1920x1200 (display_activate() in ../kmscon-9.0.0/src/uterm_drm3d_video.c:155)
Feb 28 13:01:06 berbelek kmscon[3538]: [0003.846084] ERROR: uterm_drm3d_video: cannot create gbm surface (38): Function not implemented (display_activate() in ../kmscon-9.0.0/src/uterm_drm3d_video.c:171)
Feb 28 13:01:06 berbelek kmscon[3538]: [0003.846095] INFO: uterm_drm3d_video: activating display 0x5e967647ab20 to 1280x1024 (display_activate() in ../kmscon-9.0.0/src/uterm_drm3d_video.c:155)
Feb 28 13:01:06 berbelek kmscon[3538]: [0004.015201] ERROR: uterm_drm3d_video: cannot create gbm surface (38): Function not implemented (display_activate() in ../kmscon-9.0.0/src/uterm_drm3d_video.c:171)
Feb 28 13:01:39 berbelek sudo[3637]:  rulatir : TTY=pts/1 ; PWD=/home/rulatir ; USER=root ; COMMAND=/usr/bin/systemctl edit --full [email protected]
Feb 28 13:02:06 berbelek kmscon[3538]: [0064.020119] INFO: pty: child exited: pid: 3571 status: 0 (sig_child() in ../kmscon-9.0.0/src/pty.c:516)
Feb 28 13:02:29 berbelek sudo[3745]:  rulatir : TTY=pts/1 ; PWD=/home/rulatir ; USER=root ; COMMAND=/usr/bin/systemctl start [email protected]
Feb 28 13:03:06 berbelek kmscon[3538]: [0124.029060] INFO: pty: child exited: pid: 3669 status: 0 (sig_child() in ../kmscon-9.0.0/src/pty.c:516)
Feb 28 13:04:06 berbelek kmscon[3538]: [0184.037594] WARNING: eloop: cannot read signalfd (11): Resource temporarily unavailable (shared_signal_cb() in ../kmscon-9.0.0/src/eloop.c:374)

My graphics card is GeForce GTX 960.

My driver is proprietary 550.54.14, nvidia-dkms Arch package.

My kmscon is this AUR package, but I have also tried the kmscon-git and kmscon-patched-git packages with identical results.

My service file:

[Unit]
Description=KMS System Console on %I
Documentation=man:kmscon(1)
After=systemd-user-sessions.service
After=plymouth-quit-wait.service
Before=getty.target
Conflicts=getty@%i.service
OnFailure=getty@%i.service
IgnoreOnIsolate=yes
ConditionPathExists=/dev/tty0

[Service]
ExecStart=/usr/bin/kmscon "--vt=%I" --seats=seat0 --no-switchvt --no-hwaccel --no-drm --debug
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes

[Install]
WantedBy=getty.target

I added --debug. --no-hwaccel and --no-drm are leftovers from trying every combination of --<option>, --no-<option> and not specifying the respective option at all, for hwaccel and drm. All combinations result in the errors pasted above.

I am trying to get kmscon to work as an alternative to the kernel framebuffer console because that is also broken with the newest NVIDIA drivers (last one that works is 535). This leaves me with a graphical-only system without a fallback console support whatsoever. I can't use Ctrl+Alt+F<n> to switch to virtual consoles, and systemctl isolate multi-user.target drops me to dead black screen.

If there is no simple solution to this issue, can you recommend an alternative that will restore my system's basic console functionality?

sixel support

first and foremost thanks for the awesome work here!

i am very interested in adding sixel support, @Aetf do you have any pointers where to start?

Errors on building because of missing

Hi there,

First of all, thanks a lot for keeping KMSCON alive!! I was very glad to find that this is still being working on.

I am trying to build on GNU/Linux Debian 11 on aarch64, and I see this on the building process, which then fails:


../src/kmscon_terminal.c: In function ‘kmscon_terminal_register’:
../src/kmscon_terminal.c:627:2: error: implicit declaration of function ‘tsm_vte_set_backspace_sends_delete’ [-Werror=implicit-function-declaration]
  627 |  tsm_vte_set_backspace_sends_delete(term->vte,
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Any idea on what's going on?

Thanks!

Support running from non-root virtual console

Running KMSCON from X or a VT works fine with root privileges (e.g. using sudo), and fails when when run unprivileged inside an X session.

However, logging into a TTY and running KMSCON without root privileges results in a total system freeze.

Is there a way to run kmscon unprivileged?

version: 8-40-g01dd02a

Wrong paths on Arch Linux / AUR

Installing on Arch Linux via AUR (kmscon-patched-git, libtsm-patched-git) now does not work anymore
after latest change #9

running kmscon does not work because /usr/bin/kmscon contains the wrong path

AUR package creates a

/usr/lib/kmscon/kmscon/kmscon

Editing AUR configure options and/or kmscon shellscript that calls the binary manually fixed the situation so that for example systemctl start kmscon works again

meson.build fails to respect pkg-config xkbcommon --cflags

If xkbcommon.pc specifies a different include dir, a build failure can ensue in kmscon because one target seems to ignore the Cflags from xkbcommon.pc.

[    6s] [16/85] cc -Isrc/mod-bbulk.so.p -Isrc -I../src -Iexternal -I../external -I/usr/include/libxkbcommon -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -std=gnu99 -O0 -ffast-math -fno-strict-aliasing -ffunction-sections -fdata-sections -fstack-protector -fvisibility=hidden -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -include /home/abuild/rpmbuild/BUILD/kmscon-9.0.0/x86_64-suse-linux/config.h -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fPIC -MD -MQ src/mod-bbulk.so.p/kmscon_mod_bbulk.c.o -MF src/mod-bbulk.so.p/kmscon_mod_bbulk.c.o.d -o src/mod-bbulk.so.p/kmscon_mod_bbulk.c.o -c ../src/kmscon_mod_bbulk.c
[    6s] [17/85] /usr/bin/python3 /home/abuild/rpmbuild/BUILD/kmscon-9.0.0/tools/embedded_file.py --regex '^/\*.*$' '' --regex '^ \*.*$' '' --regex '^[ \t]*' '' --regex '[\r\n]' '' ../src/text_gltex_atlas.vert src/mod-gltex.so.p
[    6s] [18/85] cc -Isrc/libconf.a.p -Isrc -I../src -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -std=gnu99 -O0 -ffast-math -fno-strict-aliasing -ffunction-sections -fdata-sections -fstack-protector -fvisibility=hidden -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -include /home/abuild/rpmbuild/BUILD/kmscon-9.0.0/x86_64-suse-linux/config.h -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fPIC -MD -MQ src/libconf.a.p/conf.c.o -MF src/libconf.a.p/conf.c.o.d -o src/libconf.a.p/conf.c.o -c ../src/conf.c
[    6s] FAILED: src/libconf.a.p/conf.c.o 
[    6s] cc -Isrc/libconf.a.p -Isrc -I../src -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -std=gnu99 -O0 -ffast-math -fno-strict-aliasing -ffunction-sections -fdata-sections -fstack-protector -fvisibility=hidden -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -include /home/abuild/rpmbuild/BUILD/kmscon-9.0.0/x86_64-suse-linux/config.h -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fPIC -MD -MQ src/libconf.a.p/conf.c.o -MF src/libconf.a.p/conf.c.o.d -o src/libconf.a.p/conf.c.o -c ../src/conf.c
[    6s] ../src/conf.c:40:10: fatal error: xkbcommon/xkbcommon.h: No such file or directory
[    6s]    40 | #include <xkbcommon/xkbcommon.h>

Build error

../kmscon/src/text_pixman.c:135:7: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
                if (!tp->surf[i]) {
                    ^~~~~~~~~~~~
../kmscon/src/text_pixman.c:160:9: note: uninitialized use occurs here
        return ret;
               ^~~
../kmscon/src/text_pixman.c:135:3: note: remove the 'if' if its condition is always false
                if (!tp->surf[i]) {
                ^~~~~~~~~~~~~~~~~~~
../kmscon/src/text_pixman.c:116:9: note: initialize the variable 'ret' to silence this warning
        int ret;
               ^
                = 0
1 error generated.

Maybe some variables needs to be initialized

diff --git a/src/kmscon_conf.c b/src/kmscon_conf.c
index 2f3b151..387b6b0 100644
--- a/src/kmscon_conf.c
+++ b/src/kmscon_conf.c
@@ -732,7 +732,7 @@ int kmscon_conf_new(struct conf_ctx **out)
 		/* Video Options */
 		CONF_OPTION_BOOL_FULL(0, "drm", aftercheck_drm, NULL, NULL, &conf->drm, true),
 		CONF_OPTION_BOOL(0, "hwaccel", &conf->hwaccel, false),
-		CONF_OPTION(0, 0, "gpus", &conf_gpus, NULL, NULL, NULL, &conf->gpus, KMSCON_GPU_ALL),
+		CONF_OPTION(0, 0, "gpus", &conf_gpus, NULL, NULL, NULL, &conf->gpus, (void*)KMSCON_GPU_ALL),
 		CONF_OPTION_STRING(0, "render-engine", &conf->render_engine, NULL),
 
 		/* Font Options */
diff --git a/src/text_pixman.c b/src/text_pixman.c
index 060e1f0..d9a054e 100644
--- a/src/text_pixman.c
+++ b/src/text_pixman.c
@@ -113,7 +113,7 @@ static int alloc_indirect(struct kmscon_text *txt,
 {
 	struct tp_pixman *tp = txt->data;
 	unsigned int s, i, format;
-	int ret;
+	int ret = 0;
 
 	log_info("using blitting engine");
 
diff --git a/src/uterm_drm3d_video.c b/src/uterm_drm3d_video.c
index 2dd3b5a..4da6ed4 100644
--- a/src/uterm_drm3d_video.c
+++ b/src/uterm_drm3d_video.c
@@ -411,7 +411,7 @@ static int video_init(struct uterm_video *video, const char *node)
 	};
 	const char *ext;
 	int ret;
-	EGLint major, minor, n;
+	EGLint major, minor, n = 0;
 	EGLenum api;
 	EGLBoolean b;
 	struct uterm_drm_video *vdrm;

'glyph' may be used uninitialized in 'kmscon_font_pango_render' (src/font_pango.c)

I'm working to update the Nixpkgs version of kmscon (see NixOS/nixpkgs#178749), and I ran into an interesting warning thrown by the compiler:

[16/85] Compiling C object src/mod-pango.so.p/font_pango.c.o
FAILED: src/mod-pango.so.p/font_pango.c.o 
gcc -Isrc/mod-pango.so.p -Isrc -I../src -Iexternal -I../external -I/nix/store/fd9xgi1wnr21cf6r4g4wg0r1x3q1sfmp-libtsm-4.0.2//ni
x/store/fd9xgi1wnr21cf6r4g4wg0r1x3q1sfmp-libtsm-4.0.2/include -I/nix/store/h3rq434kc322x4jmzfzijfvvw4dn28q9-pango-1.50.7-dev/in
clude/pango-1.0 -I/nix/store/00gc9zv7daj8dx5nnv22klw8y09df1dp-fontconfig-2.13.94-dev/include -I/nix/store/0iyadd7k48mwx2g21rms1
4y6a8k13ca7-freetype-2.12.1-dev/include/freetype2 -I/nix/store/92p7s7grpcwx8jlbnjc7vhw2kqggr6xv-glib-2.72.1-dev/include -I/nix/store/92p7s7grpcwx8jlbnjc7vhw2kqggr6xv-glib-2.72.1-dev/include/glib-2.0 -I/nix/store/rk79fi264q6bc5mmvcabajh9kvqr7018-glib-2.72.1/lib/glib-2.0/include -I/nix/store/k1prvgi3vr3ln80wgh37ckaihwwg1w5a-harfbuzz-3.3.2-dev/include/harfbuzz -I/nix/store/ak01zssa4jdsswn6gixaxzdw6kjiqc3l-libxkbcommon-1.4.0-dev/include -I/nix/store/vb5r08wxkarnl9sqnz2888w99lvfwhzn-libglvnd-1.4.0-dev/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -std=gnu99 -O0 -ffast-math -fno-strict-aliasing -ffunction-sections -fdata-sections -fstack-protector -fvisibility=hidden -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -include /build/source/build/config.h -fPIC -pthread -MD -MQ src/mod-pango.so.p/font_pango.c.o -MF src/mod-pango.so.p/font_pango.c.o.d -o src/mod-pango.so.p/font_pango.c.o -c ../src/font_pango.c
../src/font_pango.c: In function 'kmscon_font_pango_render':
../src/font_pango.c:436:14: error: 'glyph' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  436 |         *out = glyph;
      |         ~~~~~^~~~~~~
cc1: all warnings being treated as errors

I don't have much experience with writing/debugging C code, so I was unsure if this was a nonissue, or if the code should be edited to remove the compiler warning. (Adding -Wno-error=maybe-uninitialized works to suppress the error, however.)

New release

Hi @Aetf

Can you release a new release with the latest changes? Thanks!

Cheers,

redshift does not work in conjunction with kmscon

redshift has a (-m drm) option, which allow it to work with the kernels console (on a tty). That does not work with kmscon though. I presume that this is because kmscon itself interacts with the drm subsystem and therefore ignores / overrides the gamma ramps?
Unfortunately I am not very knowledgeable this area, so I can't say if this is an issue with kmscon, redshift or both. Or if that can be expected to work at all..

Display of unicode-test.txt has error in some glyphs

docs/unicode-test.txt Line 3, first 13 symbols for example are internally rendered bigger and then
some small part of that rendered glyph is displayed: like some edge of a circle/square on other symbols (like emojis)

since kmscon uses Pango i checked in KDE, xfce4-terminal with

pango-view --text="♉♊♋♌♍♎♏♐♑♒" --font="DejaVu Sans Mono"

Result: color emoji due to font replacement/missing glyphs (?) and correct size with font - rending by default should be cairo
However

pango-view --backend=ft2 --text="♉a♊s♋d♌f♍♎♏♐♑♒" --font="DejaVu Sans Mono"

Result: larger black/white glyphs (similar to parts displayed in kmscon) but complete symbols but different symbol and "normal" font size.

/etc/kmscon/kmscon.conf 
font-name=DejaVu Sans Mono
font-size=16
vt=5
no-switchvt

beside some glyphs of docs/unicode-test.txt the following emojis exhibit the problem too for example:

😀😂🙀😈😇😤🙌🙈🙏

According to kmscon docs it uses freetype2 so it might be some issue with different fonts from that side?
Also, this might be "duplicate" of dvdhrm#133

System: Arch Linux, Intel HD4000 integrated in CPU i7-3770

wrong install path for .service files

Configure kmscon-9.0.0 with

[    1s] + /usr/bin/meson --buildtype=plain --prefix=/usr --libdir=/usr/lib64 --libexecdir=/usr/libexec --bindir=/usr/bin --sbindir=/usr/sbin --includedir=/usr/include --datadir=/usr/share --mandir=/usr/share/man --infodir=/usr/share/info --localedir=/usr/share/locale --sysconfdir=/etc --localstatedir=/var --sharedstatedir=/var/lib --wrap-mode=nodownload --auto-features=enabled . x86_64-suse-linux

after installation, our rpmbuild notices a misplacement of .service files:

[    6s] RPM build errors:
[    6s]     Installed (but unpackaged) file(s) found:
[    6s]    /usr/lib64/systemd/system/kmscon.service
[    6s]    /usr/lib64/systemd/system/[email protected]

unit files must go to pkg-config systemd --variable=systemdsystemunitdir, not ${libdir}/systemd/system.

Bugs of `Esc[nE` and `Esc[nF`

From dvdhrm#142

When I am using pacman , I found:
Error output in kmscon:

[]$ sudo pacman -Sy
:: Synchronizing package databases…
 core
 extra
 core is up to date extra is up to date[]$

Correct output in getty, xterm, qterminal, konsole, etc

[]$ sudo pacman -Sy
:: Synchronizing package databases...
 core is up to date
 extra is up to date
[]$ 

I wrote a sample code to simulate it, and got the same outputs:

#include <stdio.h>
#include <unistd.h>

// from pacman-6.0.1/src/pacman/util.c: 1835
/* Moves console cursor `lines` up */
void console_cursor_move_up(unsigned int lines)
{
    printf("\x1B[%dF", lines);
}

/* Moves console cursor `lines` down */
void console_cursor_move_down(unsigned int lines)
{
    printf("\x1B[%dE", lines);
}

/* Erases line from the current cursor position till the end of the line */
void console_erase_line(void)
{
    printf("\x1B[K");
}

int main()
{
    printf(":: Synchronizing package databases...\n");
    printf(" %s\n", "core");
    printf(" %s\n", "extra");
    sleep(1);
    
    console_cursor_move_up(2);
    printf(" %s is up to date", "core");
    console_erase_line();
    
    console_cursor_move_down(1);
    printf(" %s is up to date", "extra");
    console_erase_line();
    
    printf("\n");

    return 0;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.