Agent terminal commands fail when workspace path contains apostrophe

Environment:
Version: 2.3.23 (user setup)
VSCode Version: 1.105.1
Commit: 655ee705c6c7b6da1da481d0fdf13191d5e3e980
Date: 2026-01-06T04:26:58.029Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200

When my workspace path contains an apostrophe (e.g., C:\Users…\Test’s Work…), all terminal commands executed through the AI agent fail with PowerShell parsing errors.
Even simple commands like python --version fail with errors like:
At C:\Users…\AppData\Local\Temp\ps-script-xxx.ps1:34 char:134+ … FromBase64String(‘’{1}‘’))) …Missing ‘)’ in method call.The string is missing the terminator: ‘.
The error appears to be in Cursor’s internal PowerShell wrapper scripts (ps-script-*.ps1 in Temp), where apostrophes in paths are being double-escaped incorrectly (’‘{1}’').
My default terminal profile is set to Command Prompt, but Cursor still uses PowerShell wrappers internally for AI-executed commands.

Hey, thanks for the report. This is a known issue with handling apostrophes in paths on Windows.

Workaround: rename your project folder and remove the apostrophe from the name (for example, “Test’s Work” → “Tests Work”). After that, the Agent terminal should work.

We’ve reported this bug to the dev team: Terminal Parsing Issues With Apostrophes In Paths

This happens because Cursor uses internal PowerShell wrapper scripts to run Agent commands, and they don’t escape apostrophes in paths correctly.

Hi @deanrie could this be a larger problem beyond just the terminal, affecting everything? See this post in Reddit.

This is still happening. It renders the tool worthless in many situations for me and I am now using other tools for much of my work, since I do not want to rename my folder, it really should just work.

My company name has an apostrophe in it so the base folder that is kept backed up has an apostrophe which cannot be removed. This has rendered most of the code execution by cursor completely broken for months. This is a serious issue that shouldn’t be too hard to fix :upside_down_face:

@piecole, I get it. If the apostrophe in the company name is baked into your backup structure, renaming really isn’t an option.

One quick question: which exact character is in the path? It matters because this is actually two different bugs:

  • Curly apostrophe (U+2019, ')
    • When the LLM generates a tool call, it normalizes it into a regular ', and Windows/macOS treat those as different folder names. Result: files get written into a duplicate folder, reads and writes get out of sync, and changes can be lost without any clear error.
  • Straight apostrophe (U+0027, ')
    • Our internal PowerShell wrapper scripts escape apostrophes incorrectly, so any agent terminal command fails with a parsing error.

A workaround that covers both cases is to create a directory junction to a path without an apostrophe:

mklink /J C:\dev\company "C:\Users\<you>\OneDrive - Company's Name\..."

Then open C:\dev\company in Cursor. It’s a junction, not a copy, so the files stay in the original folder and your backup keeps working as before.

For both bugs, I’ll raise this internally again with fresh reports. I can’t share an ETA for a fix yet. Let me know which apostrophe you have in your path, and whether the junction helped.

Its a straight apostrophe (U+0027, '). This workaround, using mlink to make a path without the apostrophe, has helped!

Was thinking of going back to using Cursor, but this bug still exists. It’s really unbelievable, no other software I’ve tried has this bug. Really needs to be fixed, renders Cursor totally useless for me.