mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 23:42:03 +00:00
revert: restore original editor command fallback logic for zed support
- Revert getExecutableCommand to use original fallback logic - Revert getDiffCommand to use slice(0, -1) pattern - Maintain proper support for zed editor with multiple command options ['zed', 'zeditor'] - Keep the caching optimization for commandExists
This commit is contained in:
parent
94a5d828bd
commit
87dc618a21
2 changed files with 8 additions and 6 deletions
|
|
@ -34,9 +34,11 @@ function getExecutableCommand(editorType: EditorType): string {
|
|||
const commands =
|
||||
process.platform === 'win32' ? commandConfig.win32 : commandConfig.default;
|
||||
|
||||
// For editors with multiple commands (like zed), try to find the first available one
|
||||
// Otherwise, just return the first (and only) command
|
||||
return commands.find((cmd) => commandExists(cmd)) || commands[0];
|
||||
// Try to find the first available command
|
||||
const availableCommand = commands.find((cmd) => commandExists(cmd));
|
||||
|
||||
// Return the first available command, or fall back to the last one in the list
|
||||
return availableCommand || commands[commands.length - 1];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue