You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support $env:EDITOR being a .bat/.cmd script on Windows #1882
Describe the feature or problem you'd like to solve
I would like to use an external editor via Ctrl-G. My external editor is opened via a wrapper Batch script
Proposed solution
Support external editors that are started via Batch (.bat/.cmd) scripts on Windows.
Example prompts or workflows
$env:EDITOR='my-editor.cmd'
copilot
# When Copilot launches, press Ctrl-G to edit the prompt in the external editor
Additional context
Today, GitHub Copilot CLI does not support your external editor being a Batch (.bat/.cmd) script. If your $env:EDITOR is something like "my-editor.cmd", pressing Ctrl-G fails with "Error: spawn EINVAL".
Since Node 18.20.0 / 20.12.0 / 21.7.0 (CVE-2024-27980, April 2024), child_process.spawn('<file>.cmd', ...) synchronously throws EINVAL unless shell: true is passed. A one-line fix on the Ctrl+G launch path covers .cmd and .bat together without per-extension logic:
(Anthropic's claude-code LSP-spawn paths got this same fix for the same root cause: anthropics/claude-code#27061, #51191, #53814.)
Worth re-framing this as a bug rather than a feature request — npm-installed editors always end in .cmd on Windows, so any global npm bin used as $EDITOR errors out with Error: spawn EINVAL on Node ≥ 18.20.0.
This appears to be resolved as of GitHub Copilot CLI v1.0.85. Please update to that release or a newer stable version. We're closing this as completed. If it still happens, please comment with your version and reproduction steps.
Activity
mu88 commentedon Apr 13, 2026
Thx for filing this issue - I also stumbled over it today when trying to configure VS Code
ccstr commentedon May 8, 2026
Cross-referencing anthropics/claude-code#57215 — same root cause in another major Windows TUI consumer.
Since Node 18.20.0 / 20.12.0 / 21.7.0 (CVE-2024-27980, April 2024),
child_process.spawn('<file>.cmd', ...)synchronously throwsEINVALunlessshell: trueis passed. A one-line fix on the Ctrl+G launch path covers.cmdand.battogether without per-extension logic:(Anthropic's
claude-codeLSP-spawn paths got this same fix for the same root cause: anthropics/claude-code#27061, #51191, #53814.)Worth re-framing this as a bug rather than a feature request — npm-installed editors always end in
.cmdon Windows, so any global npm bin used as$EDITORerrors out withError: spawn EINVALon Node ≥ 18.20.0.priyankvora257 commentedon May 19, 2026
thanks for filing an issue, I have the same problem, do we know what is their cadence in terms of fixing and releasing new version.
copilot-cli-bot commentedon Sep 16, 2026
This appears to be resolved as of GitHub Copilot CLI v1.0.85. Please update to that release or a newer stable version. We're closing this as completed. If it still happens, please comment with your version and reproduction steps.
fix(windows-terminal): start VS Code via batch file
fix(windows-terminal): start VS Code via batch file