0 Unable to type in the Terminal?
Mike Griese редактировал(а) эту страницу 2021-12-13 09:48:14 -06:00

(This post is largely taken from discussion in #8045, #4448, and #9890)

Are you unable to type in the Windows Terminal, but every other application on your system seems to be running fine? Then you might need to manually enable the "Touch, Keyboard, and Handwriting Panel Service" in the OS. This (admittedly, poorly named) service is in charge of maintaining the modern input stack, which includes keyboard input.

You can confirm that the "Touch Keyboard and Handwriting Panel" service is running with the command:

sc query TabletInputService

Which should get you something like:

image

If you're seeing that the service is running, the next thing to check is if ctfmon.exe is also running. Apparently, ctfmon.exe is the real important process, which the service is just used to resurrect.

> tasklist /v /fi "imagename eq ctfmon.exe" /fo list

Image Name:   ctfmon.exe
PID:          10828
Session Name: Console
Session#:     1
Mem Usage:    26,536 K
Status:       Running
User Name:    REDMOND\migrie
CPU Time:     0:01:05
Window Title: N/A

image

It needs to be running with a stable PID. So run that command a few times and make sure that the PID isn't changing.

Also, can you check InputServiceEnabled in the registry? You can do that with:

reg query hklm\software\microsoft\input /v InputServiceEnabled

Which should give you something like:

HKEY_LOCAL_MACHINE\software\microsoft\input
InputServiceEnabled REG_DWORD 0x1

If that fails, then it's possible some process is using msctfmonitor.dll in a way that's preventing ctfmon.exe from spawning successfully. To check this, run:

tasklist /m msctfmonitor.dll

That should produce output like:

PS C:\Users\ngupton> tasklist /m msctfmonitor.dll

Image Name                     PID Modules
========================= ======== ============================================
taskhostw.exe                12000 MsCtfMonitor.dll

If you see any processes in that output, go ahead and terminate them, then restart your PC. In this case, you'd taskkill /f /pid 12000 to kill process 12000. After rebooting, input should work once again.