0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Mapped Ctrl+Shift+E in Neovim (WSL + Windows Terminal)

Posted at

The Problem

I wanted to toggle NvimTree using Ctrl+Shift+E in Neovim (running inside WSL, through Windows Terminal).

It works in VSCode by default, but in Neovim, <C-S-e> didn't do anything.

What I Tried

  1. Ran cat, pressed Ctrl+Shift+E → it outputs ^[[1;6E
  2. Ran :echo getcharstr() in Neovim → got nothing.
    → Neovim drops unknown escape sequences from terminal.
  3. Realized Ctrl+Shift+E isn't supported in terminfo/libtermkey.
    → Neovim never receives it.

The Hack

Added this keybinding in Windows Terminal settings.json:

{
  "command": { "action": "sendInput", "input": "§" },
  "keys": "ctrl+shift+e"
}

Then in Neovim:

vim.keymap.set("n", "§", "<cmd>NvimTreeToggle<CR>")

👉 Works! I can now toggle the file tree with Ctrl+Shift+E.


Note: I haven’t fully verified this behaviour in every environment, but in many terminal setups Neovim fails to recognise certain modified keys (e.g., Ctrl+Shift+E) because the escape sequence sent by the terminal isn’t defined in terminfo/libtermkey.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?