From 1eed36ec1cdd573ef5a095dcafff12a6dd4daab2 Mon Sep 17 00:00:00 2001 From: blasty Date: Thu, 6 Aug 2026 16:36:53 +0200 Subject: help: reach the cheatsheet with H as well as F1 F1 is swallowed before it ever reaches us on at least one setup here -- the app's own binding fires when the key is injected directly, zellij has no F1 binding of its own, and every common F1 encoding written straight into the pane (SS3 ESC O P, CSI ESC [11~, CSI-u ESC [1;1P) opens it. So the key is being eaten by something upstream, which is not ours to fix, and a cheatsheet reachable only through a function key is fragile anyway: terminals and multiplexers claim them routinely. H opens and closes it too. '?' stays with the incremental search, which is what it has always done in the code views. --- tests/test_scenarios.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/test_scenarios.py b/tests/test_scenarios.py index b4d5990..e138946 100644 --- a/tests/test_scenarios.py +++ b/tests/test_scenarios.py @@ -554,6 +554,16 @@ async def s_help(c: Ctx): await c.press("escape") await c.wait(lambda: not isinstance(app.screen, HelpScreen), 10) c.check("Esc closes it", not isinstance(app.screen, HelpScreen)) + # F-keys get eaten by terminals/multiplexers upstream of us, so the + # cheatsheet must not be reachable ONLY through F1. + await c.press("H") + opened_h = await c.wait(lambda: isinstance(app.screen, HelpScreen), 10) + c.check("H opens the cheatsheet too", opened_h, + f"screen={type(app.screen).__name__}") + if opened_h: + await c.press("H") + await c.wait(lambda: not isinstance(app.screen, HelpScreen), 10) + c.check("H closes it again", not isinstance(app.screen, HelpScreen)) @scenario("strings") -- cgit v1.3.1-sl0p