SchOS/cmd
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nexoniarz 7c0f7c7d01 tty: the switch chord is a setting, because only the host knows the answer
Third guess at a chord, and the third one would have been wrong too: a display
manager that grabs Ctrl+Alt+F<n> matches loosely, so Ctrl+Alt+Shift+F2 never
reaches the guest either. Extra modifiers do not get past a loose grab.

The real problem is that this is not knowable from inside. A key the host
swallowed is indistinguishable from a key nobody pressed, so the guest cannot
probe for a free combination, and there is no combination that is free
everywhere:

  the HOST takes    Alt+F4, Alt+F2, Ctrl+Alt+F1..F6 (loosely matched),
                    Ctrl+Alt+digit (QEMU's own console tabs)
  APPLICATIONS want Alt+anything (Meta -- zsh binds Meta-digit as
                    digit-argument), Ctrl+letter, Ctrl+Shift+digit
                    (Ctrl+Shift+2 types ^@), bare F-keys
  the LAYOUT wants  AltGr+letter

So it is a setting. VT_SETCHORD/VT_GETCHORD, and in userspace:

    chvt -c ctrl+shift+F       Ctrl+Shift+F1..F6   (the new default)
    chvt -c ctrl+alt+shift+F
    chvt -c alt+1
    chvt -c off                no chord; chvt N is then the only way
    chvt                       report the active terminal and the chord

`off` is a legitimate setting rather than a failure mode. On a machine whose
host grabs everything worth binding, `chvt N` is the honest answer.

The default moved to Ctrl+Shift+F1..F6: display managers bind Ctrl+Alt+F<n>,
not Ctrl+Shift+F<n>, and Ctrl+Shift with a *function* key is not a character
on any layout -- unlike Ctrl+Shift+digit, which is.

Caught while writing it: VTC_RALT was 0x08 while kbd.h's RALT is (1<<7), since
(1<<3) is CAPSLOCK. A chord set from userspace with AltGr would simply never
have matched, and the only symptom would have been a key that does nothing.
A _Static_assert now holds the two headers together.

Verified: Ctrl+Alt+F2 leaves the screen byte-identical, Ctrl+Shift+F2 switches,
Ctrl+Shift+F1 returns to a pixel-identical tty1, and chvt -c round-trips
through alt+1 and off and back. schfs-check passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VQ7Qx8E1q1M1bbCq8QLHS2
2026-09-13 13:13:38 +02:00
..
chvt tty: the switch chord is a setting, because only the host knows the answer 2026-09-13 13:13:38 +02:00
fbinfo Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
init Give userspace a raw disk: /dev/hda and /dev/hdb 2026-08-09 22:19:40 +02:00
inputtest Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
nettest net: recvfrom says who sent it, and a datagram is delivered whole 2026-08-15 16:23:06 +02:00
ping net: the socket layer stops saying yes to things it did not do, and ping works 2026-09-12 17:14:35 +02:00
reflink schfs: the commit barrier, reflink, and attributes with an index over them 2026-08-15 16:02:02 +02:00
schattr schfs: the commit barrier, reflink, and attributes with an index over them 2026-08-15 16:02:02 +02:00
schinit kernel: processes have an environment now, and zsh is the shell 2026-09-12 23:26:50 +02:00
shmtest Rename Schunix to SchOS; the kernel becomes SchIFT 2026-08-09 14:09:59 +02:00
socktest net: the socket layer stops saying yes to things it did not do, and ping works 2026-09-12 17:14:35 +02:00