Reliable letter-based default keybinds + kitty keyboard protocol

alt+tab is grabbed by desktop WMs and alt+arrows are re-encoded or
swallowed by several terminals, leaking plain arrow keys into the
focused window. Primary defaults are now letter chords which every
terminal delivers via ESC-prefix: alt+w (switcher), alt+h/alt+l
(snap), alt+m (maximize). The alt+tab/arrow variants stay as extra
bindings, and standalone/client now enable the kitty keyboard
protocol (DISAMBIGUATE_ESCAPE_CODES) when the terminal supports it
so even those are delivered unambiguously (Konsole 23.08+, kitty,
foot, wezterm, ghostty). 34/34 integration checks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-15 20:15:17 +02:00
parent 8296081557
commit ca13abc9b7
9 changed files with 152 additions and 32 deletions

View File

@@ -346,6 +346,14 @@ def main():
maxed = next(w for w in wmx["windows"] if w["id"] == sw_open["id"])
check("alt+up maximerar fönstret", maxed["width"] >= 95,
f"geometri: {maxed}")
# Bokstavs-varianten: alt+m ska toggla tillbaka (återställa)
disp.send(key_event(ch="m", modifiers="ALT"))
time.sleep(0.3)
app.send({"type": "list_windows", "request_id": "lrest"})
wre = app.recv_until("window_list")
restored = next(w for w in wre["windows"] if w["id"] == sw_open["id"])
check("alt+m återställer (bokstavs-bind)", 45 <= restored["width"] <= 55,
f"geometri: {restored}")
app.send({"type": "close_window", "window_id": sw_open["id"]})
# ── 4f. Copy-mode: alt+c, sök, avsluta ───────────────────────────