Cursor -g fails on paths containing parentheses/brackets (Svelte route groups) due to shell eval in wrapper

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:

Steps to Reproduce

  1. 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

Hey, thanks for the detailed bug report. Including the root cause analysis and a proposed fix is really helpful.

This is a known issue with the CLI wrapper using eval, which doesn’t handle shell metacharacters in paths. The team knows about it and it’s being tracked internally, and your report helps us prioritize it.

As a workaround for now, you can patch the local wrapper script at /usr/local/bin/cursor by replacing the eval call with a direct exec, like you suggested. That should unblock you until a proper fix ships.

Let me know if you run into anything else.

Y’all keep closing these bugs automatically. The problem with paths with spaces (same issue) was reported in October of 2025 (at least). Doesn’t this seem like a pretty fundamental issue? Spaces in names aren’t that uncommon (for example, editing the Claude desktop config on macOS is under “Application Support”)

1 Like