Add shortcut help popup

This commit is contained in:
2026-09-18 14:32:58 +00:00
parent 6e420b2db5
commit a5e8e32f1e
5 changed files with 268 additions and 8 deletions
+15 -2
View File
@@ -74,6 +74,19 @@ class TmuxIntegrationTests(unittest.TestCase):
self.assertEqual(self.hub.run(["show-options", "-gv", "prefix2"]).stdout.strip(), "None")
self.assertIn("choose", self.hub.run(["list-keys", "-T", "prefix", "g"]).stdout)
def test_help_popup_replaces_status_shortcut_list(self) -> None:
self.hub.ensure_server()
binding = self.hub.run(["list-keys", "-T", "prefix", "?"]).stdout
self.assertIn("display-popup", binding)
self.assertIn(" keys", binding)
status_right = self.hub.run(
["show-options", "-gv", "status-right"]
).stdout
self.assertIn("C-a ?", status_right)
self.assertNotIn("choose", status_right)
self.assertNotIn("refresh", status_right)
self.assertNotIn("C-a R", status_right)
def test_configures_isolated_server_and_adds_without_duplicates(self) -> None:
self.assertTrue(self.hub.ensure_server())
endpoints = [Endpoint.local(), Endpoint.remote("orangepi")]
@@ -136,9 +149,9 @@ class TmuxIntegrationTests(unittest.TestCase):
self.assertEqual(position, "top")
self.assertEqual(mouse, "on")
self.assertEqual(clipboard, "on")
self.assertIn("连接已断开", status_right)
self.assertIn("C-a ?", status_right)
self.assertTrue(expanded_status_left.startswith("#[bold,fg=colour81]"))
self.assertIn("C-a R", status_right)
self.assertNotIn("C-a R", status_right)
self.assertIn("连接已断开", dead_format)
self.assertIn("Ctrl+A R", dead_format)
self.assertIn("client_width", inactive_window_format)