CLI on Windows leaves a cmd.exe running forever when starting the TypeScript language server

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

On Windows, every Cursor CLI agent session leaks a cmd.exe that never exits. The TypeScript language server never starts.

The CLI resolves npx through find-executable. For an npx.cmd shim that helper returns the full invocation:

{ cmd: “C:\Windows\System32\cmd.exe”, args: [“/C”, “C:\path\to\npx.cmd”] }

The TypeScript provider in @anysphere/local-lsp keeps only cmd and discards args:

const resolved = findExecutable(“npx”, )
spawn(resolved.cmd, [“-y”, “typescript-language-server”, “–stdio”], { windowsHide: true })

The process that stays alive is:

C:\WINDOWS\System32\cmd.exe -y typescript-language-server --stdio

Without /C, cmd.exe does not run npx. It opens an interactive prompt and waits. windowsHide does not make that process exit. With Windows Terminal as the default console host, each of these consoles can show up as a terminal window.

worker.log records the same failure:

Starting typescript-language-server npxPath=C:\WINDOWS\System32\cmd.exe
Child Typescript LSP process spawned with PID: …
TypeScript Server stderr chunk: ERROR: [object Object]

In one project the worker log showed 129 start attempts. One cmd.exe stayed alive per agent session. Running that exact command line by hand does not exit.

Steps to Reproduce

  1. On Windows, use a Node install where npx is npx.cmd (npm or nvm).
  2. Start the Cursor CLI agent in any workspace.
  3. Read %USERPROFILE%.cursor\projects<project>\worker.log.
  4. List processes. A cmd.exe remains with command line: C:\WINDOWS\System32\cmd.exe -y typescript-language-server --stdio

Expected Behavior

Spawn cmd.exe /C npx.cmd -y typescript-language-server --stdio, using the args that find-executable already returns. The process should exit when npx or the language server exits.

Operating System

Windows 10/11

Version Information

CLI Version 2026.10.19-6bbf2c4

Additional Information

Confirmed in the installed bundle index.js of that CLI version, modules ../utils/dist/find-executable.js and @anysphere/local-lsp typescript-provider. The provider log line calls the resolved command npxPath, and on Windows that value is C:\WINDOWS\System32\cmd.exe.

OS build: Windows 11 10.0.26200.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @Eric_Ambiel,

Your reading is correct. On Windows the CLI resolves npx to its npx.cmd shim, which needs to run as cmd.exe /C npx.cmd ..., but the language server launch keeps only the cmd.exe part. So each agent session starts cmd.exe -y typescript-language-server --stdio, which just sits at a prompt, and the TypeScript language server never comes up.

This is still the case in current builds, and I’ve flagged it to the team with your details.

There’s no setting to turn that launch off for now. To clean up the leftover processes, you can run this in PowerShell:

Get-CimInstance Win32_Process -Filter "Name='cmd.exe'" | Where-Object { $_.CommandLine -like '*typescript-language-server --stdio*' } | ForEach-Object { Stop-Process -Id $_.ProcessId }

The CLI itself keeps working without the language server; it just won’t have TypeScript diagnostics from it.