mirror of
https://github.com/nushell/nushell.git
synced 2025-08-17 04:31:14 +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:
@ -180,6 +180,14 @@ pub fn evaluate_repl(
|
||||
);
|
||||
}
|
||||
|
||||
if engine_state.get_config().use_kitty_protocol {
|
||||
if line_editor.can_use_kitty_protocol() {
|
||||
line_editor.enable_kitty_protocol();
|
||||
} else {
|
||||
warn!("Terminal doesn't support use_kitty_protocol config");
|
||||
}
|
||||
}
|
||||
|
||||
loop {
|
||||
let loop_start_time = std::time::Instant::now();
|
||||
|
||||
|
Reference in New Issue
Block a user