mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-26 21:14:35 -07:00
Fix: make ctrl+x use preferred editor (#16556)
This commit is contained in:
committed by
GitHub
parent
778de55fd8
commit
8dbaa2bcea
@@ -112,6 +112,16 @@ export function checkHasEditorType(editor: EditorType): boolean {
|
||||
return commands.some((cmd) => commandExists(cmd));
|
||||
}
|
||||
|
||||
export function getEditorCommand(editor: EditorType): string {
|
||||
const commandConfig = editorCommands[editor];
|
||||
const commands =
|
||||
process.platform === 'win32' ? commandConfig.win32 : commandConfig.default;
|
||||
return (
|
||||
commands.slice(0, -1).find((cmd) => commandExists(cmd)) ||
|
||||
commands[commands.length - 1]
|
||||
);
|
||||
}
|
||||
|
||||
export function allowEditorTypeInSandbox(editor: EditorType): boolean {
|
||||
const notUsingSandbox = !process.env['SANDBOX'];
|
||||
if (isGuiEditor(editor)) {
|
||||
@@ -143,12 +153,7 @@ export function getDiffCommand(
|
||||
if (!isValidEditorType(editor)) {
|
||||
return null;
|
||||
}
|
||||
const commandConfig = editorCommands[editor];
|
||||
const commands =
|
||||
process.platform === 'win32' ? commandConfig.win32 : commandConfig.default;
|
||||
const command =
|
||||
commands.slice(0, -1).find((cmd) => commandExists(cmd)) ||
|
||||
commands[commands.length - 1];
|
||||
const command = getEditorCommand(editor);
|
||||
|
||||
switch (editor) {
|
||||
case 'vscode':
|
||||
|
||||
Reference in New Issue
Block a user