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.
This commit is contained in:
parent
beff8c91aa
commit
6f3740bc3b
@ -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',
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user