nwalkewicz
New member
- Local time
- 10:32 AM
- Posts
- 2
- OS
- Windows 11 Pro
I use Windows for development and I noticed that Ctrl+Space isn't being passed correctly to Neovim within my terminal (Windows Terminal 1.19.10821.0).
I have mingw installed, which includes
To make it even more confusing, Neovim Qt receives Ctrl+Space just fine, just like WSL does. This tells me it isn't a problem with my Neovim config and it isn't a problem with Windows Terminal or Alacritty, but it's likely a problem with some API that they're both using and Neovim Qt isn't. I just have no clue where to go from here, so if anyone can help, I'd really appreciate it!
Edit: I tried out this sample app in Go (Fix Control+Space not sent to program running in terminal by lonnywong · Pull Request #16298 · microsoft/terminal) and it seems to receive the character just fine. I'm thinking maybe this is an issue specific to Neovim's Windows binary, but even more specifically, how the
P.S. Here are the versions and configs:
Alacritty (0.13.2 (bb8ea18)):
Neovim (NVIM v0.9.5; Build type: RelWithDebInfo; LuaJIT 2.1.1703942320):
(Sorry for the lack of syntax highlighting, there were no options for toml or lua)
I have mingw installed, which includes
cat
, so I used cat -v
to see if the ^@
character is being passed into applications, or just being ignored entirely. It seems like it's somewhere in the middle: I don't see the ^@
character immediately when I type it into cat -v
, but I do see it echoed back to me after hitting Enter. This problem isn't isolated to Windows Terminal, though; it also happens in Alacritty. In both terminal emulators, this issue stops when I use WSL; WSL immediately receives ^@
and echoes it back to me, both as I type it into cat -v
and again after hitting Enter.To make it even more confusing, Neovim Qt receives Ctrl+Space just fine, just like WSL does. This tells me it isn't a problem with my Neovim config and it isn't a problem with Windows Terminal or Alacritty, but it's likely a problem with some API that they're both using and Neovim Qt isn't. I just have no clue where to go from here, so if anyone can help, I'd really appreciate it!
Edit: I tried out this sample app in Go (Fix Control+Space not sent to program running in terminal by lonnywong · Pull Request #16298 · microsoft/terminal) and it seems to receive the character just fine. I'm thinking maybe this is an issue specific to Neovim's Windows binary, but even more specifically, how the
nvim.exe
binary receives that particular character.P.S. Here are the versions and configs:
Alacritty (0.13.2 (bb8ea18)):
Code:
[keyboard]
bindings = [
{ key = "Space", mods = "Control", chars = "\u0000" }
]
Neovim (NVIM v0.9.5; Build type: RelWithDebInfo; LuaJIT 2.1.1703942320):
Code:
local cmp = require("cmp")
local cmp_select = { behavior = cmp.SelectBehavior.Select }
local lsp = vim.lsp
cmp.setup({
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'nvim_lua' },
{ name = 'luasnip', keyword_length = 2 },
{ name = 'nvim_lsp_signature_help' },
}),
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-p>"] = cmp.mapping.select_prev_item(cmp_select),
["<C-n>"] = cmp.mapping.select_next_item(cmp_select),
["<C-y>"] = cmp.mapping.confirm({ select = true }),
["<Tab>"] = cmp.mapping.confirm({ select = true }),
["<CR>"] = cmp.mapping.confirm({ select = true }),
-- RELEVANT CODE FOR THE POST IS HERE --
["<C-Space>"] = cmp.mapping.complete(),
["<C-@>"] = cmp.mapping.complete(),
-- Everything else in this config works, I double-checked.
-- All of this code works perfectly when used in Linux (or Neovim Qt).
}),
})
(Sorry for the lack of syntax highlighting, there were no options for toml or lua)
- Windows Build/Version
- Version 22H2 (OS Build 22621.3447)
Last edited:
My Computer
System One
-
- OS
- Windows 11 Pro
- Computer type
- PC/Desktop