tty: AltGr+F1..F6 by default, and AltGr+-/+ to step
The sweet spot was available the whole time and I ruled it out by writing
"AltGr+anything" when the true statement is "AltGr+*letter*".
A Polish layout wants AltGr with a letter -- ą ć ę ł ń ó ś ź ż. AltGr with a
function key produces nothing on any layout, no window manager binds it, and
no application asks for it. It is the one combination the host, applications
and the keyboard layout all leave alone, and the previous three commits talked
themselves out of it on a technicality that was mine, not the hardware's.
Verified rather than argued, with QEMU sendkey and screendump hashes:
AltGr+F2 -> tty2
AltGr+F1 -> back, pixel-identical to the start
AltGr+a -> reaches zsh, so ą still types
That distinction is only expressible because Right Alt became its own modifier
bit two commits ago. Sharing ALT is harmless for typing -- neither is used to
look up a character -- and made this impossible to say.
Also added, since it was asked for in the same breath: minus and equals step
to the previous and next terminal, on whatever the chord's modifiers are. They
skip terminals that are not in use -- the same `opened` count VT_GETSTATE
reports -- because six terminals with two shells on them means four blank
screens in between, and cycling past those is worse than not having the key.
AltGr+= -> tty2, again -> wraps to tty1 (only two in use)
AltGr+- -> tty2
chvt -c still moves all of it, and `chvt` reports both halves.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VQ7Qx8E1q1M1bbCq8QLHS2
This commit is contained in:
parent
7c0f7c7d01
commit
65906639da
8 changed files with 118 additions and 31 deletions
|
|
@ -368,7 +368,8 @@ erase_one(struct vt *v)
|
|||
int
|
||||
console_vt_hotkey(int key)
|
||||
{
|
||||
if (key < KEY_VT_SWITCH || key >= KEY_VT_SWITCH + NVT)
|
||||
if (key != KEY_VT_PREV && key != KEY_VT_NEXT &&
|
||||
(key < KEY_VT_SWITCH || key >= KEY_VT_SWITCH + NVT))
|
||||
return 0;
|
||||
// A program that called VT_SETMODE(VT_PROCESS) owns switching on this
|
||||
// terminal. Dropping the chord entirely would be worse than not binding it:
|
||||
|
|
@ -376,7 +377,9 @@ console_vt_hotkey(int key)
|
|||
// falls through to the line discipline as an ordinary key.
|
||||
if (!vt_kernel_switches())
|
||||
return 0;
|
||||
vt_switch(key - KEY_VT_SWITCH);
|
||||
if (key == KEY_VT_PREV) vt_cycle(-1);
|
||||
else if (key == KEY_VT_NEXT) vt_cycle(+1);
|
||||
else vt_switch(key - KEY_VT_SWITCH);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -392,7 +395,8 @@ consoleintr(int (*getc)(void))
|
|||
|
||||
// Terminal switching happens before the line discipline sees anything:
|
||||
// the chord is not input for the terminal you are leaving.
|
||||
if (c >= KEY_VT_SWITCH && c < KEY_VT_SWITCH + NVT) {
|
||||
if (c == KEY_VT_PREV || c == KEY_VT_NEXT ||
|
||||
(c >= KEY_VT_SWITCH && c < KEY_VT_SWITCH + NVT)) {
|
||||
release(&input_lock);
|
||||
int taken = console_vt_hotkey(c);
|
||||
acquire(&input_lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue