Join GitHub today
Feature Request: Support arbitrary arguments for keybindings #1142
Keybindings need to support arbitrary args, so that the handlers can parse their own arg values.
This is a feature that needs to absolutely be spec'd before implemented.
* Add a spec draft for Keybindings Arguments. Specs #1142. Just read the spec :) * Apply suggestions from code review Co-Authored-By: Carlos Zamora <firstname.lastname@example.org> * Include notes on reliability, security, and `Handle`ing Keybinding Args * Add some extra details from review * Split up ActionArgs and ActionEventArgs * Clarify _not_ handling an action * Add some notes on parsing args * Add some future considerations on extensions * Updating spec to remove the bulk of the `IActionArgs` and `IActionEventArgs` implementations, as they're redundant.
This commit also transitions our keybinding events and event handlers to a TypedEventHandler model with an "event args" class, as specified in the keybinding arguments specification (#1349). In short, every event can be marked Handled independently, and a Handled event will stop bubbling out to the terminal. An unhandled event will be passed off to the terminal as a standard keypress. This unifies our keybinding event model and provides a convenient place for binding arguments to live. Fixes #2285. Related to #1349, #1142.