Summary
After using the “Open Chat as Editor” feature, reopening the project results in a permanent black screen that prevents Cursor from loading properly.
Environment
- OS: Linux (Ubuntu 24.04 via WSL)
- Cursor Version: 2.3.35
- Workspace: Local project
Steps to Reproduce
- Open any project in Cursor
- Open a chat/composer session
- Click “Open Chat as Editor” option
- Close Cursor
- Reopen the same project
- Result: Black screen - Cursor UI doesn’t load
Root Cause
The issue is caused by corrupted data in the workspace’s state.vscdb SQLite database, specifically in the composer.composerData key:
- Corrupted selection state: The
selectedComposerIds and lastFocusedComposerIds arrays contain objects like {"preserveFocus":false} instead of actual composer ID strings
- Incomplete composer entries: Some entries in
allComposers array are missing required fields (like name, subtitle, lastUpdatedAt)
Example of corrupted data:
{
"selectedComposerIds": [{"preserveFocus": false}, {"preserveFocus": false}],
"lastFocusedComposerIds": [{"preserveFocus": false}],
"allComposers": [
// ... valid entries ...
{
"type": "head",
"composerId": "e9744bdd-e78c-4ef7-b873-f0253553abbc",
"createdAt": 1763349950948,
"unifiedMode": "chat",
// Missing: name, subtitle, lastUpdatedAt, etc.
}
]
}
Workaround
IMPORTANT: Close Cursor completely before applying any fix!
Users can fix this by editing the state.vscdb file directly:
Location of state.vscdb:
- Linux:
~/.config/Cursor/User/workspaceStorage/<workspace-id>/state.vscdb
- macOS:
~/Library/Application Support/Cursor/User/workspaceStorage/<workspace-id>/state.vscdb
- Windows:
%APPDATA%\Cursor\User\workspaceStorage\<workspace-id>\state.vscdb
Method 1: Python Script (Recommended - Preserves Chat History)
Save this as fix_cursor_black_screen.py:
#!/usr/bin/env python3
import sqlite3
import json
import sys
DB_PATH = "./state.vscdb"
def fix_composer_data(db_path):
"""Fix corrupted composer.composerData that causes black screen"""
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
try:
# Get current composer data
cursor.execute("SELECT value FROM ItemTable WHERE key = 'composer.composerData'")
result = cursor.fetchone()
if not result:
print("No composer.composerData found - nothing to fix")
return True
# Parse JSON
composer_data = json.loads(result[0])
# Remove incomplete composer entries (missing critical fields)
original_count = len(composer_data.get('allComposers', []))
composer_data['allComposers'] = [
c for c in composer_data.get('allComposers', [])
if 'name' in c or 'subtitle' in c or 'lastUpdatedAt' in c
]
new_count = len(composer_data['allComposers'])
# Fix corrupted selection arrays
composer_data['selectedComposerIds'] = []
composer_data['lastFocusedComposerIds'] = []
# Update database
updated_json = json.dumps(composer_data, separators=(',', ':'))
cursor.execute(
"UPDATE ItemTable SET value = ? WHERE key = 'composer.composerData'",
(updated_json,)
)
conn.commit()
print("✓ Successfully fixed composer.composerData")
print(f" Removed {original_count - new_count} incomplete composer entries")
print(f" Cleared corrupted selection state")
return True
except Exception as e:
print(f"Error: {e}")
return False
finally:
conn.close()
if __name__ == "__main__":
print("Fixing Cursor black screen issue...")
success = fix_composer_data(DB_PATH)
if success:
print("\n✓ Fix complete! You can now restart Cursor.")
else:
print("\n✗ Fix failed. You may need to delete state.vscdb entirely.")
sys.exit(0 if success else 1)
Run it:
# Navigate to your workspace storage directory
cd ~/.config/Cursor/User/workspaceStorage/<workspace-id>/
# Run the fix
python3 fix_cursor_black_screen.py
Method 2: SQL Command (Quick Fix)
# Close Cursor first!
cd ~/.config/Cursor/User/workspaceStorage/<workspace-id>/
sqlite3 "./state.vscdb" "
UPDATE ItemTable
SET value = json_set(
value,
'$.selectedComposerIds', json('[]'),
'$.lastFocusedComposerIds', json('[]')
)
WHERE key = 'composer.composerData';
"
This clears the corrupted selection state but doesn’t remove incomplete entries.
Method 3: Nuclear Option (Loses Chat History)
# Delete the entire state database (Cursor will recreate it)
rm state.vscdb
Recommendation: Use Method 1 (Python script) as it preserves your chat history while fixing the corruption.
Additional Notes
Deleting the entire state.vscdb file fixes the black screen but causes loss of all chat/composer history. The surgical fix above preserves chat history while fixing the corruption.