Allow using function keys F21-F35 for keybindings (#14201)

I feel like the limitations on what can be bound are too strict.

if an app _does_ support the Kitty keyboard protocol (Neovim,
Reedline), I can map the function keys (F27-F35 as listed below).

In Reedline everything works perfectly. The issue is for some reason we
limit the keys that can be bound in Nushell, so I am unable to do that.
This commit is contained in:
Dom 2024-10-30 12:22:47 +01:00 committed by GitHub
parent a6c2c685bc
commit e0bb5a2bd2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -862,10 +862,10 @@ fn add_parsed_keybinding(
c if c.starts_with('f') => c[1..] c if c.starts_with('f') => c[1..]
.parse() .parse()
.ok() .ok()
.filter(|num| (1..=20).contains(num)) .filter(|num| (1..=35).contains(num))
.map(KeyCode::F) .map(KeyCode::F)
.ok_or(ShellError::InvalidValue { .ok_or(ShellError::InvalidValue {
valid: "'f1', 'f2', ..., or 'f20'".into(), valid: "'f1', 'f2', ..., or 'f35'".into(),
actual: format!("'{keycode}'"), actual: format!("'{keycode}'"),
span: keybinding.keycode.span(), span: keybinding.keycode.span(),
})?, })?,