Where does the bug appear (feature/product)?
Cursor CLI
Describe the Bug
Summary
Using the cursor CLI with -g <file:line:col> fails when the file path contains ( ) and/or [ ] (common in SvelteKit route-group paths like (counterparties)/[customer_id]).
The error comes from the shell wrapper (/usr/local/bin/cursor), not from project code.
Environment
- Cursor CLI installed at:
/usr/local/bin/cursor - OS: macOS
- Project path example:
/Users/.../src/routes/app/(counterparties)/customers/[customer_id]/[email protected]
Steps to Reproduce
- In terminal, run:
cursor -r -g '/Users/.../src/routes/app/(counterparties)/customers/[customer_id]/[email protected]:601:5'
Expected Behavior
Cursor should open the file at the specified line/column regardless of valid path characters in the filesystem path.
Actual Result
Cursor fails to open the file and prints:
/usr/local/bin/cursor: eval: line 20: syntax error near unexpected token `('
/usr/local/bin/cursor: eval: line 20: `ELECTRON_RUN_AS_NODE=1 ".../Cursor" ".../cli.js" -r -g /Users/.../(counterparties)/...'
Could not open [email protected] in the editor.
The editor process exited with an error: (code 1).
Likely Cause
/usr/local/bin/cursor runs the local CLI via:
eval "$CURSOR_CLI" "$@"
Using eval re-parses arguments and breaks on unescaped shell metacharacters in file paths (like ( and )), even though they are valid path characters.
Proposed solution
Patch local wrapper to avoid eval and exec the command directly (or quote/escape arguments before eval).
E.g.
if [ "$CURSOR_CLI_MODE" = "local" ]; then
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
exit $?
else
"$CURSOR_CLI" "$@"
exit $?
fi
Impact
This breaks “go to file” flows for SvelteKit projects using route groups and dynamic segment folders, and can surface repeatedly from tools that pass -g file:line:col.
Operating System
MacOS
Version Information
Version: 2.5.25
VSCode Version: 1.105.1
Commit: 7150844152b426ed50d2b68dd6b33b5c5beb73c0
Date: 2026-02-24T07:17:49.417Z
Build Type: Stable
Release Track: Default
Electron: 39.4.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Darwin arm64 24.6.0
Does this stop you from using Cursor
No - Cursor works, but with this issue