microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.27k stars 8.27k forks source link

win32 input mode: Keyboard number pad not working for Vim in terminal version 1.1 #7080

Closed Muhimen123 closed 4 years ago

Muhimen123 commented 4 years ago

After updating the windows terminal to version 1.1 from Microsoft store, my number pad isn't functioning properly. However, this only happens when I use nvim in the terminal. For other stuffs, it works just fine. At first I thought it's the problem with the nvim I am working with so I reinstalled it but the problem still stayed. I also tried another keyboard and the same problem occurs.

Environment

Windows build number: Microsoft Windows [Version 10.0.18362.959]
Windows Terminal version (if applicable): 1.1

Other software: Neovim version 0.4.3

Steps to reproduce

Expected behavior

As I type digits using the number pad, the numbers should get properly displayed or typed in the file

Actual behavior

While in insert mode of nvim, if I press 0 from the number pad if gets out from the insert mode and takes me into command.

DHowett commented 4 years ago

Does your number pad work if you run nvim outside of Windows Terminal, from a standard console window?

Muhimen123 commented 4 years ago

I tried it in windows command prompt and it works fine.

zadjii-msft commented 4 years ago

As a workaround, can you see what happens if you put the following setting at the root of your settings file?

"experimental.input.forceVT": true,
Muhimen123 commented 4 years ago

@zadjii-msft Thanks, It's working now.

DHowett commented 4 years ago

Triaged into backlog as a bug. The only difference between the numberpad 0 in WT and Conhost is that in WT it's missing the NUM_LOCK flag. If NeoVim requires this (which it shouldn't), we'll need to figure out how to generate it.

DHowett commented 4 years ago

Actually, I'm recanting this. It's by design.

I just checked in vim on my own machine, and vim switches between replace and insert mode in the traditional console when you press VK_NUMPAD0. All the way back to the 2017 versions of Windows.

This is happening in Terminal now because before 1.1, Terminal pretended that the two different versions of 0 on your keyboard were the same thing. Now it knows they're different. input.forceVT makes it pretend they're the same.