-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Desktop: Extension command parser doesn't respect quotes in paths with spaces #6417
Copy link
Copy link
Closed
Description
Describe the bug
The Desktop app's extension command parser doesn't respect quotes when parsing commands with spaces. The splitCmdAndArgs() function uses .split(/\s+/) which splits on all whitespace, breaking paths like /Applications/IntelliJ IDEA.app/... even when quoted.
To Reproduce
- Go to Settings → Extensions
- Click "Add Extension"
- Enter command:
"/Applications/IntelliJ IDEA.app/Contents/jbr/Contents/Home/bin/java" -classpath "/path/with spaces/lib.jar" com.example.Main - Save the extension
- Check
~/.config/goose/config.yaml- the command is incorrectly split with quotes appearing in wrong places
Expected behavior
Quoted strings should be preserved as single arguments, similar to shell behavior. The CLI already uses shlex::split for this - the Desktop UI should use equivalent parsing (e.g., shell-quote npm package).
Screenshots
N/A
Please provide the following information
- OS & Arch: macOS
- Interface: UI
- Version: v1.18.0-block
- Extensions enabled: N/A (occurs during extension setup)
- Provider & Model: N/A (configuration issue)
Additional context
Current code (ui/desktop/src/components/settings/extensions/utils.ts):
export function splitCmdAndArgs(str: string): { cmd: string; args: string[] } {
const words = str.trim().split(/\s+/); // ← breaks on all whitespace
const cmd = words[0] || '';
const args = words.slice(1);
return { cmd, args };
}Workarounds:
- Create symlinks without spaces
- Use wrapper scripts
- Manually edit
config.yaml
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels