diff --git a/metainfo.xml b/metainfo.xml
index c2d8e1e3c1..d3246cac9a 100644
--- a/metainfo.xml
+++ b/metainfo.xml
@@ -111,6 +111,7 @@
Ensure inserting new tabs happens right next to the currently active tab (#1695)
Adds `MoveTabToLeft` and `MoveTabToRight` actions to move tabs around (#1695)
Adds `MoveTabTo` action to move tabs to a specific position (#1695)
+ Adds handling of control codes for Ctrl+5|6|7|8 (#1701)
Adds CenterCursor (`zz`) vi motion
diff --git a/src/vtbackend/InputGenerator.cpp b/src/vtbackend/InputGenerator.cpp
index fd0c9e2650..0b59cb165f 100644
--- a/src/vtbackend/InputGenerator.cpp
+++ b/src/vtbackend/InputGenerator.cpp
@@ -94,6 +94,22 @@ bool StandardKeyboardInputGenerator::generateChar(char32_t characterEvent,
return true;
}
+ // handle Control + 5, 6, 7
+ if (modifiers == Modifier::Control && crispy::ascending('5', chr, '7'))
+ {
+ // part of the control characters
+ // 5 6 7 corresponds to 1D 1E 1F
+ append(static_cast(24 + characterEvent - '0'));
+ return true;
+ }
+
+ // handle Control + 8 which is DEL
+ if (modifiers == Modifier::Control && chr == '8')
+ {
+ append('\x7F');
+ return true;
+ }
+
if (modifiers == Modifier::Control && characterEvent >= '[' && characterEvent <= '_')
{
append(static_cast(chr - 'A' + 1)); // remaining C0 characters 0x1B .. 0x1F