nosh: User-space virtual terminal test and questions

From: Guillermo <gdiazhartusch_at_gmail.com>
Date: Sat, 5 Jan 2019 17:59:39 -0300

Hello,

So, I've gotten around to testing user-space VTs with nosh tools on
Gentoo, as described in the nosh Guide. Mostly console-fb-realizer,
but I also tested console-termio-realizer on a kernel VT for
comparison. This was in a VirtualBox VM, so there were two framebuffer
devices available: the one provided by the VirtualBox Guest Additions
'vboxvideo' kernel module (vboxdrmfb), and the kernel's VESA
framebuffer device (vesafb). The combination of vboxvideo with
console-fb-realizer was explosive, I got a (guest) kernel panic. But
console-fb-realizer with the VESA framebuffer device worked, as did
console-termio-realizer. "Worked" meaning that I could log in and get
an interactive shell using the user-space VT.

For ease of troubleshooting I wanted a minimal setup instead of the
full-blown one of nosh-bundles and the external formats import
subsystem. I left the Gentoo standard agetty processes on /dev/tty1 to
/dev/tty6 alone, and had console-fb-realizer or
console-termio-realizer take /dev/tty8, and communicate directly with
console-terminal-emulator via /run/dev/vc1, with neither a multiplexor
(at first) nor an input method front-end processor. I also set up the
customary TUI login service using vc-get-tty and open-controlling-tty,
and managed to deal with the BSDness of the requirements on font and
keyboard map files with the help of FreeBSD's SVN repository :)

So now the questions:

1) What is the proper way (if any) to switch between kernel VTs and
user-space VTs? What I found out:
  * console-multiplexor-control with a numeric command and the active
kernel VT, or just 'tty', as the vtname, could switch to a different
kernel VT, just like Alt + function key.
  * console-multiplexor-control with an '8' command and the active
kernel VT, or just 'tty', as the vtname, and Alt + F8, could both
switch to to the user-space VT, with both realizers.
  * With console-termio-realizer, Alt + F1 in the user-space VT could
switch back to the first kernel VT, but I expected that it would
likely work, given that this arrangement is a terminal realized on
another terminal.
  * With console-fb-realizer, Alt + F1 did nothing but print "WARNING:
Unknown input message" on /dev/console. The messages were probably
coming from console-terminal-emulator, as I supposed (and tested
later) that this is designed to switch from a user-space VT to
*another* user-space VT, if console-fb-realizer is communicating with
a console-multiplexor process.

So that left 'console-multiplexor-control 0_at_tty1', which did switch to
the first kernel VT... but only if run as root. Looking more closely,
it seems that when a kernel VT is specified as the vtname,
console-multiplexor-control is just a wrapper around an ioctl() call
with a VT_ACTIVATE command, which apparently works on Linux for an
unprivileged process if the VT is its controlling terminal. And for a
user-space VT it isn't, just like it isn't either for an X11 terminal
like rxvt-unicode. So, is there an alternative to
console-multiplexor-control as root?

2) Key combinations with Alt (e.g. Alt + f or Alt + b to move forward
or backward one word on Bash) did not work with neither
console-fb-realizer nor console-termio-realizer. Any idea why, or does
this just happen to me?

3) More strangely, Ctrl + x (e.g. to exit from GNU nano) did not work
with console-termio-realizer, but did with console-fb-realizer. Other
key combinations with Ctrl worked fine. Any idea why, or does this
just happen to me?

4) With console-termio-realizer, green is blue and blue is green :D
Not with console-fb-realizer, though. Any idea why, or does this just
happen to me?

Thanks,
G.
Received on Sat Jan 05 2019 - 20:59:39 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC