From 4ffb1c8cf932a8c290d3fd9163969234360c163d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 9 Oct 2024 09:45:55 -0700 Subject: [PATCH] core: modifier-only keys do not reset pending key sequences This allows nested key sequences to be used such as `ctrl+a>ctrl+b>c`. --- src/Surface.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Surface.zig b/src/Surface.zig index aa752419c..e9d8dcd1c 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -1685,7 +1685,12 @@ fn maybeHandleBinding( // No entry found. If we're not looking at the root set of the // bindings we need to encode everything up to this point and // send to the pty. - if (self.keyboard.bindings != null) { + // + // We also ignore modifiers so that nested sequences such as + // ctrl+a>ctrl+b>c work. + if (self.keyboard.bindings != null and + !event.key.modifier()) + { // Reset to the root set self.keyboard.bindings = null;