X gets a VT: keyboard, terminal switching, and a way out

Xorg uses VTs only when stat("/dev/tty0") reports Linux's tty major 4.
SchOS's terminals sit under major 1, so X ran on no VT at all: the console
kept drawing over it, Ctrl+Alt+F-keys did nothing, and nothing ended the
session. stat now reports terminals under Linux's numbers.

startx picks the VT only when uname says Linux, so root's xserverrc passes
the current one itself. An xorg.conf.d file names X's input devices, since
Alpine's Xorg looks them up through udev and SchOS has none yet.

Alt+F1..F6 and Ctrl+Alt+F1..F6 now switch terminals as on Linux, alongside
the settable chord. USB keyboards gain arrows, Home/End/PgUp/PgDn/Ins/Del
and the switch keys, which the PS/2 path always had.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S1giNvrHTrPMPw7V6x1kQ4
This commit is contained in:
Nexoniarz 2026-10-24 21:45:50 +02:00
commit 4a7165c951
5 changed files with 123 additions and 9 deletions

View file

@ -442,7 +442,8 @@ erase_one(struct vt *v)
// Keyboard input
// ---------------------------------------------------------------------------
// Ctrl+Alt+Shift+F1..F6 switch terminals. kbd.c reports them as
// Alt+F1..F6, Ctrl+Alt+F1..F6 and the settable chord (AltGr+F1..F6 by
// default) switch terminals. kbd.c reports them as
// KBD_VT_SWITCH+n so that the
// decision of what a chord *means* is made here, where the terminals are,
// rather than in a driver that should not know they exist.