Unable to open symlinks of files
Description
When I try to open a symlink of a text file I am presented with a dialog with two options "Show in Finder" and "Open as Plan Text", if I "Open as Plain Text", it get a modal "
To Reproduce
- Open Cot
- Open a file that is a symlink
- See error
Expected behavior
Open the text file. Most other editors open the linked file. vim, emacs, etc.
vim ~/somelink
where somelink is a link to ~/sometextfile
CotEditor version
Version 5.1.1 (705)
macOS version
15.3.1 (24D70)
Additional context
No response
This is intentionally designed due to the limitation of the Sandbox system in macOS. In order to detour this limitation, apps must obtain user approval through an open dialog and implement additional staff to mimic the behavior of a file located in the folder where the symlink file resides. CotEditor doesn't implement it yet.
Most other editors open the linked file. vim, emacs, etc.
These apps are not Sandboxed.
Thanks! Ok, Why sandbox? I use symlink a fair bit, so I bump into it quite often. Not sure how often others would.
Why sandbox?
The primary aim of CotEditor is to be a good citizen in the macOS world. Sandbox is the standard and recommended mechanism on macOS for protecting user data. So, CotEditor dares to accept the Sandbox environment to demonstrate its safety. In addition, Apple requires apps to be sandboxed when they are distributed in the Mac App Store.
Thanks a lot for your work on CotEditor — it’s a wonderful editor.
I would very much welcome an option to access and open symlinked files in the version of CotEditor installed from the GitHub release page. Currently symlinks cannot be opened directly, and I cannot use CotEditor as a main text editor.
Thanks again for maintaining this project!
@pravdomil The CotEditor project maintains a policy of not having different specifications for the App Store version and the non-App Store version. This has been consistent since the beginning. Furthermore, I do not believe removing Sandboxing is advisable.
Please keep in mind I have not yet rejected this request. I am merely stating the current situation and technical constraints. Fundamentally, jumping between multiple documents within a single window deviates from the standard design of macOS applications, so I am proceeding cautiously with implementation.
Starting with CotEditor 6.2.0, which will be released within this year, you can now open documents linked via aliases/symlinks from the file browser by explicitly obtaining user permission through the Open dialog. Note that while alias/symlink folders can now be opened in a separate window, they will not be expanded within the file browser.
great workaround
there is also on option in the open dialog select the whole disk root so that you can get an access to any file on that disk
and what about getting full disk access permission in the privacy & security? will that help?
@pravdomil Thank you for the suggestion. However, I generally avoid requesting or retaining more privileges than necessary in the CotEditor project, and I'm extremely cautious about requiring Full Disk Access. While I understand the convenience it could bring to users, I still consider it excessive for this feature, so I'm choosing not to implement it.