-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add kitty protocol config to nushell #10540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
If we move forward with this, there would need to be a default and that default would need to be set in the default_config.nu file in this repo. |
I see, I missed that. The default would be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thanks for the followup, this looks good to me. I don't observe any breakage in non-kitty-compatible terminals.
One small thing to fix and we should be good to go
# 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>
# Description hi hi, this makes the parsing of modifier key combos in config more general, and adds support for additional kitty keyboard protocol modifiers. It seems that support for [kitty keys](https://sw.kovidgoyal.net/kitty/keyboard-protocol) had already been added to nushell in #10540, and this was the only missing piece to making them available in keybindings. # User-Facing Changes - keybindings in config can include the super, hyper and meta modifiers (e.g. `modifier: super`, `modifier: shift_super`, etc.), and these modifiers will work in supporting terminals (kitty, foot, wezterm, alacritty...) - all permutations of snake_cased modifier combinations now behave equivalently for the purpose of describing keybindings in config (e.g. `control_alt_shift` was previously supported where `shift_control_alt` was a config error — now they're the same) # Tests None of this looks to be tested at the moment. I only found a smoke test under the nu-cli crate, and I couldn't break tests elsewhere by stuffing around with modifier handling. Works on my machine, though! ✨🌈
This PR should close #9733.
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 totrue
, it enables kitty protocol on the line editor when supported, or else it warns.Tests + Formatting
cargo fmt --all -- --check
to check standard code formatting (cargo fmt --all
applies these changes)cargo clippy --workspace -- -D warnings -D clippy::unwrap_used
to check that you're using the standard code stylecargo test --workspace
to check that all tests pass (on Windows make sure to enable developer mode)It produces an error. I don't think this is my doing since the current main also suffers this error in my local.
cargo run -- -c "use std testing; testing run-tests --path crates/nu-std"
to run the tests for the standard library