Compare commits

...

1 Commits

Author SHA1 Message Date
Tommaso Sciortino 6f3740bc3b Fix crash when vim editor is not found in PATH on Windows
Fixes #16492

This patch checks if the editor command exists before calling spawnSync.
Without this check, Node throws ENOENT when vim is not in PATH on Windows.
2026-04-02 10:27:50 -07:00
+4
View File
@@ -302,6 +302,10 @@ export async function openDiff(
if (isTerminalEditor(editor)) {
try {
if (!commandExists(diffCommand.command)) {
throw new Error(`Editor command not found: ${diffCommand.command}`);
}
const result = spawnSync(diffCommand.command, diffCommand.args, {
stdio: 'inherit',
});