From 08b926796cf582945e9814051c7cf9c9ae3f297d Mon Sep 17 00:00:00 2001 From: Jyo Date: Thu, 2 Apr 2026 23:10:19 +0530 Subject: [PATCH] Fix crash when vim editor is not found in PATH on Windows (#22423) Co-authored-by: Tommaso Sciortino --- packages/core/src/utils/editor.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/core/src/utils/editor.ts b/packages/core/src/utils/editor.ts index 29dc78fc49..dfec446433 100644 --- a/packages/core/src/utils/editor.ts +++ b/packages/core/src/utils/editor.ts @@ -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', });