View Single Post
Old 05-29-2012, 06:28 AM   #38
hawhill
Wizard
hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.hawhill ought to be getting tired of karma fortunes by now.
 
hawhill's Avatar
 
Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
Quote:
Originally Posted by knc1 View Post
Capturing the alt-F* keys is a function of the keyboard handling, not of xterm (in this thread, of matchbox-keyboard).
Well, to some extent. I can only speak for Linux, but there, it's as follows: The Kernel switches from using pure /dev/console over to /dev/ttyN when sysvinit tells it to. On /dev/ttyN, the kernel will typically handle ALT-F* and switch VGA console output between the /dev/ttyN devices. When X is running, it captures one of the /dev/ttyN devices, nowadays often overriding the ALT-F* combinations. Note that the Kernel will only switch between the *virtual* terminals /dev/ttyN here. Also, the Kernel is the instance that runs the terminal emulation for /dev/ttyN.

Graphical terminals however don't use the virtual terminals /dev/ttyN. They use pseudo terminals. For those, there is always a _pair_ of devices. Nowadays this will be the /dev/ptmx (single master for all slaves) and /dev/pts/N (slave terminal, this side is for terminal clients).
This mechanism is what xterm uses. You can't switch from pseudo terminals to virtual terminals: just try on a desktop in xterm to switch. All you potentially get is a full screen VGA terminal, but xterm has nothing to do with that, that's kernel based switching between virtual terminals, i.e. the whole X session and another virtual tty.

Quote:
The function is to start (and switch to) another instance of xterm on another /dev/tty* (of those with a handler assigned in /etc/inittab).
Possible, but a multiplexer will do that for you, too.

Quote:
A terminal multiplexer, does just that, multiplexes a single terminal instance, not create a new one. Those applications are from the days when the user only had a single set of wires to a single, physical, terminal interface.
Not related to my question concerning keyboard handling in matchbox-keyboard.
Well, it creates a new terminal device (or uses a new terminal device for old PTY style rather than PTS) for the sub-sessions of the "multiplexer". And in fact, tmux is relatively new, not from an old era. There's still good use for those applications today. An additional benefit is that you can keep your terminal session running in the "background" (detach/reattach).
hawhill is offline   Reply With Quote