From e0bb5a2bd2c3006b4298962c87e7922cce8a9313 Mon Sep 17 00:00:00 2001 From: Dom <18601956+hacker-DOM@users.noreply.github.com> Date: Wed, 30 Oct 2024 12:22:47 +0100 Subject: [PATCH] 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. --- crates/nu-cli/src/reedline_config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/nu-cli/src/reedline_config.rs b/crates/nu-cli/src/reedline_config.rs index 55179ab0ae..4c1594389e 100644 --- a/crates/nu-cli/src/reedline_config.rs +++ b/crates/nu-cli/src/reedline_config.rs @@ -862,10 +862,10 @@ fn add_parsed_keybinding( c if c.starts_with('f') => c[1..] .parse() .ok() - .filter(|num| (1..=20).contains(num)) + .filter(|num| (1..=35).contains(num)) .map(KeyCode::F) .ok_or(ShellError::InvalidValue { - valid: "'f1', 'f2', ..., or 'f20'".into(), + valid: "'f1', 'f2', ..., or 'f35'".into(), actual: format!("'{keycode}'"), span: keybinding.keycode.span(), })?,