Skip to content
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

(Seemingly) unable to bind the space key in keybindings? #6586

Closed
fishsayhelo opened this issue Sep 19, 2022 · 2 comments · Fixed by #6590
Closed

(Seemingly) unable to bind the space key in keybindings? #6586

fishsayhelo opened this issue Sep 19, 2022 · 2 comments · Fixed by #6590
Labels
enhancement New feature or request line editor Issues related to reedline question the issue author asks something
Milestone

Comments

@fishsayhelo
Copy link

Question

Hi, i am trying to set a bind to quick exit vi_normal mode that uses the space key as the keycode: option, but it never seems to work.

modifier: control
keycode: char_<CHAR: U+0020> 
mode: vi_normal
event: {
    # not actually the event i want to send, i was just using it to test things
    send: ClearScreen 
}

Things that did not cause an error but didnt work anyway:

keycode: char_<CHAR: U+0020>
keycode: CHAR: U+0020

I'm just quite confused on how to set space as a keycode binding, especially because of the attemps that did not cause an error, but did not function

@fdncred
Copy link
Collaborator

fdncred commented Sep 19, 2022

I don't believe space is a valid keycode in crossterm 0.24. Also char_ currently only works with a-z and not characters specified like U+0020, although, theoretically, someone may be able to add that since KeyCode::Char takes a rust char.

Crossterm 0.25 adds quite a bit to keycodes so maybe if we can land the reedline PR bumping it we can do more things, but I'm not positive at this point.

@fdncred fdncred added the question the issue author asks something label Sep 19, 2022
sholderbach added a commit to sholderbach/nushell that referenced this issue Sep 20, 2022
Implements nushell#6586

No special logic to prevent you from binding it in other modes!
Needs a separate change to reedline to make it available in the default
listing of `keybindings list`.
@sholderbach sholderbach linked a pull request Sep 20, 2022 that will close this issue
6 tasks
sholderbach added a commit to sholderbach/nushell that referenced this issue Sep 20, 2022
Implements nushell#6586

No special logic to prevent you from binding it in other modes!
Needs a separate change to reedline to make it available in the default
listing of `keybindings list`.
@sholderbach
Copy link
Member

The limitation was just on our parser to translate to the proper keys. Added a "space".

@sholderbach sholderbach added enhancement New feature or request line editor Issues related to reedline labels Sep 20, 2022
sholderbach added a commit that referenced this issue Sep 20, 2022
* Add "space" key to bind in vi normal mode

Implements #6586

No special logic to prevent you from binding it in other modes!
Needs a separate change to reedline to make it available in the default
listing of `keybindings list`.

* Update reedline to report the available `space`

Pulls in nushell/reedline#486
@hustcer hustcer added this to the v0.69 milestone Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request line editor Issues related to reedline question the issue author asks something
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants