input: add end_key_sequence binding action

End the currently active key sequence, if any, and flush the
keys up to this point to the terminal, excluding the key that
triggered this action.

For example: `ctrl+w>escape=end_key_sequence` would encode
`ctrl+w` to the terminal and exit the key sequence.

Normally, an invalid sequence will reset the key sequence and
flush all data including the invalid key. This action allows
you to flush only the prior keys, which is useful when you want
to bind something like a control key (`ctrl+w`) but not send
additional inputs.
This commit is contained in:
Mitchell Hashimoto
2025-12-29 12:06:36 -08:00
parent 9c9d707fc1
commit 61df50d70b
3 changed files with 24 additions and 0 deletions

View File

@@ -696,6 +696,7 @@ fn actionCommands(action: Action.Key) []const Command {
.activate_key_table_once,
.deactivate_key_table,
.deactivate_all_key_tables,
.end_key_sequence,
.crash,
=> comptime &.{},