NStefan002 / screenkey.nvim

Screencast your keys in Neovim
MIT License
291 stars 5 forks source link

[bug] Ctrl+/ displays as Ctrl+_ #30

Closed iamxiaojianzheng closed 2 months ago

iamxiaojianzheng commented 2 months ago

Problem

image

Steps to reproduce

Just normal configuration

{
    "NStefan002/screenkey.nvim",
    lazy = false,
    version = "*", -- or branch = "dev", to use the latest commit
  },

Screenkey log output

No response

Expected behavior

No response

Neovim version (nvim -v)

NVIM v0.10.0

Terminal name/version

Windows terminal 1.21.1382.0

NStefan002 commented 2 months ago

Hi, thanks for reporting. There is a well-known and very old problem with terminal keycodes. Depending on the terminal emulator you're using and (maybe) OS, some keys and a combination of keys produce the same keycode. E.g. <C-i> and <Tab> produce the same keycode and they are impossible to differentiate in most of the terminal emulators (as far as I know). I don't know much about the history of this problem so I can't go too deep about this.

Anyway, I tested <C-/> on my machine (Ubuntu 22.04, terminal: Wezterm) and it produces the correct output so I'm pretty sure this issue is not screenkey-related but rather it has to do with how your terminal emulator handles input.