mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 19:47:45 +02:00
Add kitty protocol config to nushell (#10540)
# Description Support keyboard enhancement protocol as implemented by Kitty console, hence Kitty protocol. This PR enables Nushell to use keybinding that is not available before, such as Ctrl+i (that alias to Tab) or Ctrl+e (that alias to Esc, likely I mistaken). After this PR merged and you set `use_kitty_protocol` enabled, if your console app support Kitty protocol (WezTerm, Kitty, etc.) you will be able to set more fine-grained keybinding. For Colemak users, this feature is a blessing, because some Ctrl+[hjkl] that previously unmap-able to Ctlr+[hnei] now it is. # User-Facing Changes This adds `use_kitty_protocol` config which defaults to false. When set to `true`, it enables kitty protocol on the line editor when supported, or else it warns. --------- Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
@ -115,6 +115,7 @@ pub struct Config {
|
||||
pub datetime_normal_format: Option<String>,
|
||||
pub datetime_table_format: Option<String>,
|
||||
pub error_style: String,
|
||||
pub use_kitty_protocol: bool,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
@ -180,6 +181,8 @@ impl Default for Config {
|
||||
keybindings: Vec::new(),
|
||||
|
||||
error_style: "fancy".into(),
|
||||
|
||||
use_kitty_protocol: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1200,6 +1203,9 @@ impl Value {
|
||||
"bracketed_paste" => {
|
||||
try_bool!(cols, vals, index, span, bracketed_paste);
|
||||
}
|
||||
"use_kitty_protocol" => {
|
||||
try_bool!(cols, vals, index, span, use_kitty_protocol);
|
||||
}
|
||||
// Menus
|
||||
"menus" => match create_menus(value) {
|
||||
Ok(map) => config.menus = map,
|
||||
|
Reference in New Issue
Block a user