# Fixing Remote Path Mayhem: Backslashes vs. Forward Slashes

**URL:** <https://forum.cursor.com/t/fixing-remote-path-mayhem-backslashes-vs-forward-slashes/40688>\
**Category:** Guides\
**Created:** [January 11, 2025, 7:28am UTC](https://forum.cursor.com/t/fixing-remote-path-mayhem-backslashes-vs-forward-slashes/40688 "2025-01-11T07:28:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cyril](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/cyril/32/19568_2.png) [@Cyril](https://forum.cursor.com/u/Cyril)\
**Post date:** [January 11, 2025, 7:28am UTC](https://forum.cursor.com/t/fixing-remote-path-mayhem-backslashes-vs-forward-slashes/40688/1 "2025-01-11T07:28:55Z")

</div>

# Fixing Path Separator Issues in Cursor AI’s SQLite Database

## Issue Description

Cursor AI occasionally stores Windows-style backslash paths (`\`) instead of Unix-style forward slashes (`/`) for remote SSH workspace files. This can cause issues with file handling and navigation.

## Location of the Issue

The path information is stored in SQLite database:

- Path: `%APPDATA%\Cursor\User\workspaceStorage\{workspace-id}\state.vscdb`
- Table: `ItemTable`
- Key locations:
  1. composer.composerData (JSON field)
  2. memento/workbench.parts.editor (JSON field)

## Diagnostic Commands

### 1. Check Tables

^^^powershell  
sqlite3 state.vscdb “.tables”  
^^^

### 2. Find Problematic Paths

^^^powershell

# Check for backslash paths

sqlite3 state.vscdb “.mode line” “SELECT key, value  
FROM ItemTable  
WHERE value LIKE ‘%\var\www%’;”

# Check specific composer data

sqlite3 state.vscdb “.mode line” “SELECT key, value  
FROM ItemTable  
WHERE key = ‘composer.composerData’;”  
^^^

## Fix Commands

### 1. Always Backup First

^^^powershell  
Copy-Item state.vscdb state.vscdb.backup  
^^^

### 2. Fix Composer Data

^^^powershell

# Fix specific composer entry

sqlite3 state.vscdb "  
UPDATE ItemTable  
SET value = json\_replace(  
value,  
‘$.allComposers[4].forceMode[0].fsPath’,  
‘/var/www/html/autopop.icybox.de/doc/prd/prd-workflow-template-v02.md’  
)  
WHERE key = ‘composer.composerData’;"  
^^^

### 3. Fix Workbench Editor State

^^^powershell

# Fix workbench paths

sqlite3 state.vscdb "  
UPDATE ItemTable  
SET value = REPLACE(  
value,  
‘\\var\\www\\html\\autopop.icybox.de\\doc’,  
‘/var/www/html/autopop.icybox.de/doc’  
)  
WHERE key = ‘memento/workbench.parts.editor’;"  
^^^

## Verification Commands

### 1. Check Composer Data

^^^powershell  
sqlite3 state.vscdb “.mode line” “SELECT json\_extract(value, ‘$.allComposers[4].forceMode[0].fsPath’) as current\_path,  
json\_extract(value, ‘$.allComposers[4].forceMode[0].path’) as reference\_path  
FROM ItemTable  
WHERE key = ‘composer.composerData’;”  
^^^

### 2. Check for Any Remaining Backslash Paths

^^^powershell  
sqlite3 state.vscdb “.mode line” “SELECT key, value  
FROM ItemTable  
WHERE value LIKE ‘%\var\www\html\autopop%’  
OR value LIKE ‘%\\var\\www\\html\\autopop%’;”  
^^^

## Important Notes

1. Always make a backup before modifying the SQLite database
2. Close Cursor AI before making changes
3. The database structure uses both `ItemTable` and `cursorDiskKV` tables
4. Path information can be stored in multiple formats:
  - Direct paths with forward/backslashes
  - URI encoded paths (vscode-remote://ssh-remote%2B…)
  - JSON encoded paths in configuration objects

## Troubleshooting

If issues persist:

1. Check if Cursor AI is completely closed
2. Verify the workspace ID is correct
3. Ensure all paths in the database are consistent
4. Restart Cursor AI after making changes

## Prevention

Currently, there’s no direct way to prevent Cursor AI from occasionally storing Windows-style paths. The issue seems to occur during the translation between local Windows environment and remote SSH connections.

---

<div class="post-metadata">

**Author:** ![Cyril](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/cyril/32/19568_2.png) [@Cyril](https://forum.cursor.com/u/Cyril)\
**Post date:** [January 12, 2025, 7:47am UTC](https://forum.cursor.com/t/fixing-remote-path-mayhem-backslashes-vs-forward-slashes/40688/2 "2025-01-12T07:47:25Z")

</div>

I have just created a GPT to guide users to fix the path issue, it offers a more smooth user-friendly flow

> **[ChatGPT - Cursor AI SQLite Path Fixer](https://chatgpt.com/g/g-678364e0daf88191a0ec5cc1fd7389da-cursor-ai-sqlite-path-fixer)**
>
> Guides users to fix path issues in Cursor AI workspace files.

As it is hard to predict the outcome, it is always a good idea to backup first!
