CotEditor icon indicating copy to clipboard operation
CotEditor copied to clipboard

Unable to open symlinks of files

Open pkubat opened this issue 9 months ago • 3 comments

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 " could not be handled because CotEditor cannot open files in the “symbolic link” format.

To Reproduce

  1. Open Cot
  2. Open a file that is a symlink
  3. 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

pkubat avatar Mar 11 '25 16:03 pkubat

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.

1024jp avatar Mar 12 '25 00:03 1024jp

Thanks! Ok, Why sandbox? I use symlink a fair bit, so I bump into it quite often. Not sure how often others would.

pkubat avatar Mar 12 '25 14:03 pkubat

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.

1024jp avatar Mar 13 '25 01:03 1024jp

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 avatar Nov 06 '25 14:11 pravdomil

@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.

1024jp avatar Nov 13 '25 12:11 1024jp

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.

1024jp avatar Nov 14 '25 09:11 1024jp

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

pravdomil avatar Nov 24 '25 11:11 pravdomil

and what about getting full disk access permission in the privacy & security? will that help?

pravdomil avatar Nov 24 '25 11:11 pravdomil

@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.

1024jp avatar Nov 25 '25 05:11 1024jp