nushell / reedline

A feature-rich line editor - powering Nushell
https://docs.rs/reedline/
MIT License
551 stars 155 forks source link

Tab keybind doesnt work with modifiers #763

Closed jujpenabe closed 9 months ago

jujpenabe commented 9 months ago

Arch Linux Alacritty

Hi, I'm trying to assign some custom keybinds in ~/.config/nushell/config.nu and it seems that the tab keycode plus a modifier doesn't work.

I already disabled all tab keybindings to test just the keybinding with the modifier. I also tried the same keybind with the same modifier but with another keycode and this works. It's like the modifier key doesn't work with the tab key code .

Steps to reproduce

  1. Add a keybind with tab and a modifier other than none
  2. Try your keybind in a new terminal

    Screenshots

    image The keybind I tried to achieve

fdncred commented 9 months ago

You should make sure that your terminal "hears" whatever keybindings you're trying to assign. You do this with the command keybindings listen and then hitting the key combination.

jujpenabe commented 9 months ago

You should make sure that your terminal "hears" whatever keybindings you're trying to assign. You do this with the command keybindings listen and then hitting the key combination.

I checked the key combinations heard by the terminal and surprisingly the combination control + shift + tab returns nothing.

Control + shift is heard with a different key code than tab ('L') but only the control modifier is heard.

Other modifiers are heard (control + tab, shift + tab) But the reedline keybind doesn't work with those either.

image

fdncred commented 9 months ago

You might try and enable the kitty protocol in the config.nu

  use_kitty_protocol: true # enables keyboard enhancement protocol implemented by kitty console, only if your terminal support this.

Different terminals hear different things. This is from WezTerm on Windows. image

jujpenabe commented 9 months ago

That solves the problem, now all keybinds work as expected, thanks! I thought the Kitty protocol was exclusive to the Kitty terminal.

fdncred commented 8 months ago

I thought the Kitty protocol was exclusive to the Kitty terminal.

Nope. It's exclusive to terminal that support the kitty protocol, which there are a few already. Although I can't name them.