Unable to make extention work in Cursor IDE
Additional Info:
- I have a dual boot system with Windows and vanilla Arch.
- I was able to make this work seamlessly on Windows.
- I initially encountered the same issue when using this with VScode but was fixed easily with:
-
sudo chown -R $(whoami) "$(which code)" -
sudo chown -R $(whoami) /opt/visual-studio-code -
sudo chown -R $(whoami) /usr/bin/code
-
- I used
yay -S cursor-binto install cursor.
What I tried:
- I tried to do the same with cursor, using
which cursorandwhereis cursorto locate cursor directory. - I also did
sudo chown -R $(whoami) /opt/cursor-bin
I understand that Cursor is an AppImage for linux and maybe that is the issue? but is there a fix?
I've run into this same issue as well. What I've tried (that has yet to be successful):
- Run app image with sudo
sudo ./cursor-0.xxxxx.AppImage --no-sandbox - Run with custom user directory
./cursor-0.xxxxx.AppImage --user-data-dir=~/Applications/Cursorsince the directory will have full permission control - Extract AppImage files to a writable location (I couldn't get this to run successfully)
./cursor-0.xxxxx.AppImage --appimage-extract
./squashfs-root/AppRun
All of the above encounter the same issue as the screenshot above. I believe the problem is that the mounted file system is marked as ro read-only.
I tried mount | grep cursor and found the directory mentioned in the error message as read-only.
❯ mount | grep cursor
~/cursor-0.xxxxx.AppImage on /tmp/.mount_cursorl9krmK type fuse.cursor-0.43.6x86_64.AppImage (ro,nosuid,nodev,relatime,user_id=0,group_id=0)
Tried to remount it with sudo mount -o remount,rw ~/cursor-0.xxxxx.AppImage and it changes to read-write. However, after restarting Cursor to enact the change, it reverts to read-only. 🤷🏻
Additional Info:
I have a dual boot system with Windows and vanilla Arch.
I was able to make this work seamlessly on Windows.
I initially encountered the same issue when using this with VScode but was fixed easily with:
sudo chown -R $(whoami) "$(which code)"sudo chown -R $(whoami) /opt/visual-studio-codesudo chown -R $(whoami) /usr/bin/codeI used
yay -S cursor-binto install cursor.What I tried:
- I tried to do the same with cursor, using
which cursorandwhereis cursorto locate cursor directory.- I also did
sudo chown -R $(whoami) /opt/cursor-binI understand that Cursor is an AppImage for linux and maybe that is the issue? but is there a fix?
Can you walk me through your vscode rice 😭 it looks so good + a link to your dotfiles
I have them all on my public repos... Although I think they need to be updated because I made some changes since this post. You can have a look at my dotfiles and custom configs
Thank you!
I have them all on my public repos... Although I think they need to be updated because I made some changes since this post. You can have a look at my dotfiles and custom configs
Btw was this issue fixed for you?
@resslr No, they haven't even responded on this issue in Github yet.
Looks like related to sandboxing? This extension REQUIRES modifying VSCode's files, otherwise the custom CSS simply won't work since VSCode has no way to load it.
Looks like related to sandboxing? This extension REQUIRES modifying VSCode's files, otherwise the custom CSS simply won't work since VSCode has no way to load it.
Yeah, I needed to change permissions on some directories to make this work with VS Code...but the problem is it's different for CURSOR probably because cursor is using an Appimage and and is using sandboxing.. I was able to make it work for VS Code but not for Cursor
I have submitted PR: https://github.com/be5invis/vscode-custom-css/pull/248
It should be the wrong file to modify, I tried again in my cursor and it works.
I have submitted PR: #248
It should be the wrong file to modify, I tried again in my cursor and it works.
@keyding Hopefully they will merge this... But if I want to test this, I just need to create a fork, add the lines you added, build the app and it should work?
I have submitted PR: #248 It should be the wrong file to modify, I tried again in my cursor and it works.
@keyding Hopefully they will merge this... But if I want to test this, I just need to create a fork, add the lines you added, build the app and it should work?
Yes, I've tested it and it's fine. I'm using macOS.
@mrjxtr
Or you can just modify the source code of the extension.
First, go to the extension directory
cd ~/.cursor/extensions/be5invis.vscode-custom-css-7.4.0/src
Edit extension.js, add the following code
const vscode = require("vscode");
const fs = require("fs");
const os = require("os");
const path = require("path");
const msg = require("./messages").messages;
const uuid = require("uuid");
const fetch = require("node-fetch");
const Url = require("url");
function activate(context) {
const appDir = require.main
? path.dirname(require.main.filename)
: globalThis._VSCODE_FILE_ROOT;
if (!appDir) {
vscode.window.showInformationMessage(msg.unableToLocateVsCodeInstallationPath);
}
const base = path.join(appDir, "vs", "code");
let htmlFile = path.join(base, "electron-sandbox", "workbench", "workbench.html");
// ======= Add Support Cursor IDE
if (!fs.existsSync(htmlFile)) {
htmlFile = path.join(base, "electron-sandbox", "workbench", "workbench-apc-extension.html");
}
// =======
if (!fs.existsSync(htmlFile)) {
htmlFile = path.join(base, "electron-sandbox", "workbench", "workbench.esm.html");
}
if (!fs.existsSync(htmlFile)) {
vscode.window.showInformationMessage(msg.unableToLocateVsCodeInstallationPath);
}
// ........
}
Then, reload window.
I hope this helps.
Ill try to tinker around... I'm using Arch but it might work... Thanks @keyding
@keyding unfortunately it still does not work for me.
What I did:
- I ran this command
sudo chown -R $(whoami) /usr/bin/cursor - I edited the exact file at
~/.cursor/extensions/be5invis.vscode-custom-css-7.4.0/srcwith the code that you added. - Reloaded the Window -> Enable Custom CSS and JS -> Reload Custom CSS and JS
Still I have the same error.
@be5invis Any Ideas why this is? I installed cursor using AUR and based on what I know... AUR or on the website... it is both an AppImage both would relsult on the same issue
No idea. I am not Linux expert. This seems related to readonly FSes or sandboxes.
No idea. I am not Linux expert. This seems related to readonly FSes or sandboxes.
Yeah, I am not sure how to deal with that because running sudo chown -R $(whoami) + the path does not seem to work.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.
I'm having the same issue as @mrjxtr (Linux, running Cursor as an AppImage) and have been unable to make any of the suggestions offered in this thread work. Happy to provide details, but I am commenting here to keep the issue open.
I'm having the same issue as @mrjxtr (Linux, running Cursor as an AppImage) and have been unable to make any of the suggestions offered in this thread work. Happy to provide details, but I am commenting here to keep the issue open.
Yeah, this should not be a thing since it is proven to be doable in vscode in linux, but I guess because since they are distributing it as an appimage, it makes it more complicated to overwrite things.
Did you try this? https://github.com/getcursor/cursor/issues/913#issuecomment-1726736545 Didn't work for me (changes had no effect), but might be worth a shot?
Add cursor to "full disk access" under "Privacy and security" fixes it for me.
Add cursor to "full disk access" under "Privacy and security" fixes it for me.
This is a windows feature or a distro specific setting?
Unfortunately "Full Disk Access" is a macOS-specific setting. It does not apply to AppImages on Linux.
