nushell / nushell

A new type of shell
https://www.nushell.sh/
MIT License
31.43k stars 1.61k forks source link

Function keys in kitty protocol are not correct #12706

Open MrPandir opened 4 months ago

MrPandir commented 4 months ago

Describe the bug

When I use kitty protocol and press F1 I get char: , code: 0x00f704, modifier: KeyModifiers(0x0), flags: 0b000000, kind: Press, state: KeyEventState(0x0)

How to reproduce

  1. use rio and enable kitty protocol support
  2. enable protocol support in nushell: $env.config.use_kitty_protocol = true
  3. keybindings listen
  4. press any function key, I use F1 in the examples

Expected behavior

if you don’t use the kitty protocol it works correctly, I expect the same with it enabled: code: F(1), modifier: KeyModifiers(0x0), flags: 0b000000, kind: Press, state: KeyEventState(0x0)

Screenshots

Screenshot 2024-04-30 at 21 35 12 Screenshot 2024-04-30 at 21 35 48

Configuration

key value
version 0.92.2
branch
commit_hash
build_os macos-aarch64
build_target aarch64-apple-darwin
rust_version rustc 1.77.2 (25ef9e3d8 2024-04-09) (Homebrew)
cargo_version cargo 1.77.2
build_time 2024-04-10 21:15:51 +00:00
build_rust_channel release
allocator mimalloc
features dataframe, default, sqlite, trash, which
installed_plugins

Additional context

I also checked via kitten show-key that the terminal is sending keypress events. This works correctly in the kitty terminal. Is there a way I could more accurately understand whether the problem is in nushell or in rio?

MrPandir commented 4 months ago

This is not critical, since a simple solution was found for me: I disabled the kitty protocol in rio and nushell. And nothing seemed to be broken 😃

fdncred commented 4 months ago

I just tried it in Ubuntu and it seems to work correctly. Could be a MacOS thing with crossterm. I haven't tested there yet.