Allow binding of CTRL+ALT+<c>, SHIFT+<c> and CTRL+ALT+SHIFT+<c> #580
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.
Context
Nushell exposes
control_alt
and similar keybinding modifiers, but currently it's not possible to actually use those mappings in nushell (at least on none of my keyboards).From some limited testing, it appears like GNU readline also doesn't allow mapping
CTRL+ALT+f
and similar keybinds. I don't know if there's some deeper reason behind this, or just a limitation of readline itself. I can't think of any edgecases my change would break, since it's only if you actively choose to add a binding.I use those keybinds quite extensively in other shells, so it'd be nice to have in nu as well.
Commit message
Combinations like
Ctrl+Alt+q
could not be mapped previously, since some non-us keyboard layouts use those combinations for sending characters like@
.Now, first check if there a binding was defined using that combination, else interpret as raw characters. This should not affect those special keyboard layouts, since they would be sending
Ctrl+Alt+<special char>
, rather than what would be on the US layout.E.g.
Ctrl+Alt+q
to an actionCtrl+Alt+q
on (some) german keyboards would send@
Ctrl+Alt+@
, so they are unaffected by this change (they would have to specifically mapCtrl+Alt+@
)Ctrl+Alt+q
, they get the mapped actionThis affects emacs mode and vi insert mode (vi normal mode already allows such keybindings).