SchOS/kernel/core
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nexoniarz 91a6d440d6 tty: Alt+1..6 switches terminals, and AltGr is left alone
Alt+F1..F6 was wrong in three separate ways, and the third is the one that
matters most here.

  Alt+F4            the host window manager closes the QEMU window
  Alt+F2            GNOME and KDE open a run dialog
  Ctrl+Alt+F1..F6   the host switches its *own* virtual terminals
  AltGr+anything    Polish diacritics -- a c e l n o s x z with their marks --
                    and on some setups AltGr is delivered as Ctrl+Alt
  Ctrl+Shift+key    widely bound inside applications
  Scroll Lock       not present on many keyboards

Alt+1..6 survives all of it: the number row, so no function key is involved,
and left Alt, so AltGr is untouched.

Right Alt is tracked as its own modifier bit now. It used to share ALT, which
is harmless for typing -- neither is used to look up a character -- and wrong
for chords, because it made AltGr indistinguishable from Alt.

And the test is an equality rather than a mask:

    if ((shift & (CTL | SHIFT | ALT | RALT)) == ALT && ...)

`shift & ALT` fired on Ctrl+Alt+1 and AltGr+1 as well, so a chord aimed at the
host -- or an ordinary Polish keystroke -- would have switched terminals
behind your back. That was a real bug in what shipped yesterday.

Verified with QEMU's sendkey, comparing screendump hashes:

    start (tty1)   86cee2284878
    Ctrl+Alt+2     86cee2284878   identical -- did not fire
    AltGr+2        86cee2284878   identical -- did not fire
    Alt+2          114562804a78   switched
    Alt+1          86cee2284878   back, pixel-identical to the start

schfs-check passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VQ7Qx8E1q1M1bbCq8QLHS2
2026-09-13 12:56:34 +02:00
..
console.c tty: Alt+1..6 switches terminals, and AltGr is left alone 2026-09-13 12:56:34 +02:00
dma.c Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
kalloc.c Free every usable memory region, not one contiguous run 2026-08-09 20:03:51 +02:00
main.c tty: six virtual terminals, and the plumbing that makes them terminals 2026-09-13 00:08:00 +02:00
panic.c kernel: the clock ran 7x slow because the GPU never acknowledged its interrupt 2026-09-12 21:34:36 +02:00
qr.c Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
sleeplock.c kernel: holdingsleep asks who holds the lock, not whether anyone does 2026-09-12 17:13:59 +02:00
spinlock.c Fix two bugs the Fedora move exposed 2026-08-09 19:29:21 +02:00
string.c net: the socket layer stops saying yes to things it did not do, and ping works 2026-09-12 17:14:35 +02:00
time.c kernel: the clock ran 7x slow because the GPU never acknowledged its interrupt 2026-09-12 21:34:36 +02:00
uaccess.c Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00