Add kitty protocol config to nushell - #10540
Merged
Merged
Conversation
Contributor
|
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. |
Contributor
Author
|
I see, I missed that. The default would be |
sholderbach
approved these changes
Sep 29, 2023
sholderbach
left a comment
Member
There was a problem hiding this comment.
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
hardfau1t
pushed a commit
to hardfau1t/nushell
that referenced
this pull request
Dec 14, 2023
# 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>
sholderbach
pushed a commit
that referenced
this pull request
Sep 24, 2024
# 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_protocolenabled, 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_protocolconfig 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 -- --checkto check standard code formatting (cargo fmt --allapplies these changes)cargo clippy --workspace -- -D warnings -D clippy::unwrap_usedto check that you're using the standard code stylecargo test --workspaceto 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