mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-15 14:23:02 -07:00
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:
@@ -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',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user